import ast


def is_function(node):
    """Check if the AST node is either a function
    or an async function
    """
    if (
        isinstance(node, ast.FunctionDef)
        or isinstance(node, ast.AsyncFunctionDef)
    ):
        return True
    return False