code: def decorate_init(init_decorator):
      
  
      def class_decorator(cls):
          cls.__init__ = init_decorator(cls.__init__)
          return cls
  
      return class_decorator
docs: Given a class definition and a decorator that acts on methods,
      applies that decorator to the class' __init__ method.
      Useful for decorating __init__ while still allowing __init__ to be
      inherited.