class_docstr: Dispatches events which attached plugins can react to.
docstr: Register a hook.
  
  Args:
      func: Function to be called when the event is emitted.
      *events: List of events to call this function on.
docstr_tok: ["Register","a","hook",".","Args",":","func",":","Function","to","be","called","when","the","event","is","emitted",".","*","events",":","List","of","events","to","call","this","function","on","."]
code: def register_hook(self, func: Callable, *events: EventIdenifier):
      """Register a hook.
  
      Args:
          func: Function to be called when the event is emitted.
          *events: List of events to call this function on.
      """
      self.validate_event(*events)
  
      handle: HookHandle = HookHandle(
          HookHandleId(next(self._hook_handle_id_counter)),
          events=events,
          func=func,
          pluggable=self,
      )
  
      for event in events:
          self._hook_handles[event][handle.id] = handle
      return handle
  
imports: import logging
  from collections import defaultdict
  from inspect import isclass, signature
  from itertools import count
  from queue import Queue
  from typing import Any, Callable, Dict, Iterator, List, NewType, Optional, Sequence, Set, Type, Union, cast
label_desc: Use image node_id 5 for calling the Pluggable obj's underlying member method code with example usage: obj.register_hook(func) and returns: handle