code: def hook(self, event_type='push'):
          
  
          def decorator(func):
              self._hooks[event_type].append(func)
              return func
  
          return decorator
docs: Registers a function as a hook. Multiple hooks can be registered for a given type, but the
          order in which they are invoke is unspecified.
  
          :param event_type: The event type this hook will be invoked for.