from typing import Callable
from typing import Any
import inspect


def fn_ends_with_pass(fn: Callable[..., Any]):
    """
    Check that function end with pass statement
    (probably does nothing in any way).
    Mainly used to filter callbacks with empty on_{event} methods.

    Args:
        fn (Callable[..., Any]): target Callable

    Returns:
        bool: True if there is pass in the first indentation level of fn
        and nothing happens before it, False in any other case.
    """
    source_lines = inspect.getsourcelines(fn)[0]
    if source_lines[-1].strip() == "pass":
        return True
    return False