code: def is_registered(self, event: str, handler: T.Callable) -> bool:
          
  
          return handler in self._events.get(event, [])
docs: Returns whether the given handler is registered for the
          given event.