class_docstr: Base class for all plugins.
docstr: Convience function for `BasePlugin.mark_func_as_hook`).
  
  Enables using the `@BasePlugin.hook` syntax.
  
  Can also be used as:
  `@BasePlugin.hook("some_event", "another_event")`
docstr_tok: ["Convience","function","for","`","BasePlugin.mark_func_as_hook","`",")",".","Enables","using","the","`","@","BasePlugin.hook","`","syntax",".","Can","also","be","used","as",":","`","@","BasePlugin.hook","(","``","some_event","''",",","``","another_event","''",")","`"]
code: def hook(
      cls,
      first_arg: Optional[Union[Callable, EventIdenifier]] = None,
      *other_args: EventIdenifier,
  ) -> Callable:
      """Convience function for `BasePlugin.mark_func_as_hook`).
  
      Enables using the `@BasePlugin.hook` syntax.
  
      Can also be used as:
      `@BasePlugin.hook("some_event", "another_event")`
      """
      if first_arg is None:
          # Decorator was used with parentheses, but no args
          return cls.mark_func_as_hook
  
      if isinstance(first_arg, EventIdenifier):
          # Decorator was used with args (strings specifiying the events)
          def decorator_func(func: Callable):
              return cls.mark_func_as_hook(
                  func, cast(EventIdenifier, first_arg), *other_args
              )
  
          return decorator_func
  
      # Decorator was used without args
      return cls.mark_func_as_hook(first_arg, *other_args)
  
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 BasePlugin obj's underlying member method code with example usage: obj.hook(cls, first_arg) and returns: cls, cls, decorator_func, cls