code: def document(cls):
      
      if cls.__doc__ is None:
          return cls
  
      baseclass_name = cls.mro()[-2].__name__
  
      try:
          return DOC_FUNCTIONS[baseclass_name](cls)
      except KeyError:
          return cls
docs: Decorator to document a class