code: def register(self, hook):
          
          assert callable(hook), \
              "Hook must be a callable"
          assert issubclass(hook, HookBase), \
              "The hook does not inherit from HookBase"
  
          self._registry.append(hook)
docs: Register a hook.
  
          @hook: a HookBase subclass reference.