from typing import Dict
from typing import Any
from typing import Optional
from typing import List


def pass_stmt(
    stmt_dict: Dict[str, Any],
    stmt_types: Optional[List[str]] = None,
    hash_blacklist: Optional[List[int]] = None,
    check_curated: bool = False,
    belief_cutoff: float = 0,
) -> bool:
    """Checks and edge statement dict against several filters

    Parameters
    ----------
    stmt_dict :
        The statement dict to check
    stmt_types :
        A list of statement types. If provided, specifies which types are
        allowed. If no list is provided or the list is empty, all types are
        allowed. Default: All statement types are allowed.
    hash_blacklist :
        A list of hashes that are not allowed as supporting statements for
        an edge. Default: all statements are allowed.
    check_curated :
        If True, check if the statement is curated
    belief_cutoff :
        The cutoff for belief scores

    Returns
    -------
    :
        True if statement passes, False otherwise
    """
    # Pass if type is in allowed types
    if stmt_types and stmt_dict["stmt_type"].lower() not in stmt_types:
        return False

    # Pass if hash is not in blacklist
    if hash_blacklist and stmt_dict["stmt_hash"] in hash_blacklist:
        return False

    # Pass if statement is curated
    if check_curated and not stmt_dict["curated"]:
        return False

    # Pass if belief score is above cutoff
    if belief_cutoff > 0 and stmt_dict["belief"] < belief_cutoff:
        return False

    return True