def METHOD_NAME(source: str, event: str, func: Callable, predicate: Optional[Callable]):
    if source not in _event_handlers:
        _event_handlers[source] = handlers = []
    else:
        handlers = _event_handlers[source]
    handlers.append((event, predicate, func, _get_arity(func)))