code: def hook(self, *hook_names):
          
          def wrapper(decorated):
              for hook_name in hook_names:
                  self.register(hook_name, decorated)
              else:
                  self.register(decorated.__name__, decorated)
                  if '_' in decorated.__name__:
                      self.register(
                          decorated.__name__.replace('_', '-'), decorated)
              return decorated
          return wrapper
docs: Decorator, registering them as hooks