code: def __init__(
      self,
      cls,
      doc=None,
      modulename="",
      func_doc=FunctionDoc,
      config={},
  ):
      if not inspect.isclass(cls) and cls is not None:
          raise ValueError("Expected a class or None, but got %r" % cls)
      self._cls = cls
  
      self.show_inherited_members = config.get(
          "show_inherited_class_members", True
      )
  
      if modulename and not modulename.endswith("."):
          modulename += "."
      self._mod = modulename
  
      if doc is None:
          if cls is None:
              raise ValueError("No class or documentation string given")
          doc = pydoc.getdoc(cls)
  
      NumpyDocString.__init__(self, doc)
  
      if config.get("show_class_members", True):
  
          def splitlines_x(s):
              if not s:
                  return []
              else:
                  return s.splitlines()
  
          for field, items in [
              ("Methods", self.methods),
              ("Attributes", self.properties),
          ]:
              if not self[field]:
                  doc_list = []
                  for name in sorted(items):
                      try:
                          doc_item = pydoc.getdoc(
                              getattr(self._cls, name)
                          )
                          doc_list.append(
                              (name, "", splitlines_x(doc_item))
                          )
                      except AttributeError:
                          pass  # method doesn't exist
                  self[field] = doc_list
  
imports: import inspect
  import textwrap
  import re
  import pydoc
  from warnings import warn
  import collections
  import copy
label_desc: Use image node_id 1 to create a new ClassDoc object from inherited base classes: NumpyDocString with example: obj = ClassDoc(cls, doc, modulename, func_doc, config)