code: def add_event(cls, event, event_name=None):
          
          # setattr(cls, event_name, event)
          event_name = event_name or event.__name__
          setattr(cls, event_name, types.MethodType(event, cls))
docs: Add events