code: def register_hooked(self,
                          hooks,  # type: Union[Type[Hook], Sequence[Type[Hook]]]
                          func,  # type: Hooked
                          args_gen=None  # type: Optional[ArgsGen]
                          ):
          # type: (Type[Hook], Callable, Optional[Callable]) -> None
          
          if self.hooked is None:
              self.hooked = {}
          if args_gen is None:
              args_gen = getattr(func, "call_types", {}).keys
          if not isinstance(hooks, Sequence):
              hooks = [hooks]
          for hook_cls in hooks:
              self.hooked[hook_cls] = (func, args_gen)
docs: Register func to be run when any of the hooks are run by parent
  
          Args:
              hooks: A Hook class or list of Hook classes of interest
              func: The callable that should be run on that Hook
              args_gen: Optionally specify the argument names that should be
                  passed to func. If not given then use func.call_types.keys