(s: str)
return False
Returns whether the given string should be filtered according to the forbidden keywords.
Returns whether the given string should be filtered according to the forbidden keywords.
Returns whether the given string should be filtered according to the forbidden keywords .
def is_forbidden(s: str) -> bool:
    """Returns whether the given string should be filtered according to the forbidden keywords."""
    # We can't access the variable in settings/basic.py
    # since we are in a static context without a reference to bes
    keywords = storage.get("forbidden_keywords")
    words = re.split(r"[,\s]+", keywords.strip())
    # delete empty matches
    words = [word for word in words if word]

    for word in words:
        if re.search(word, s, re.IGNORECASE):
            return True
    return False
def is_forbidden ( s : str ) -> bool : # We can't access the variable in settings/basic.py # since we are in a static context without a reference to bes keywords = storage . get ( "forbidden_keywords" ) words = re . split ( r"[,\s]+" , keywords . strip ( ) ) # delete empty matches words = [ word for word in words if word ] for word in words : if re . search ( word , s , re . IGNORECASE ) : return True return False