code: def get_doc_object(obj, what=None, doc=None, config={}):
      if what is None:
          if inspect.isclass(obj):
              what = "class"
          elif inspect.ismodule(obj):
              what = "module"
          elif callable(obj):
              what = "function"
          else:
              what = "object"
      if what == "class":
          return SphinxClassDoc(
              obj, func_doc=SphinxFunctionDoc, doc=doc, config=config
          )
      elif what in ("function", "method"):
          return SphinxFunctionDoc(obj, doc=doc, config=config)
      else:
          if doc is None:
              doc = pydoc.getdoc(obj)
          return SphinxObjDoc(obj, doc, config=config)
  
imports: import re, inspect, textwrap, pydoc
  import sphinx
  from docscrape import NumpyDocString, FunctionDoc, ClassDoc
label_desc: Use image node_id 1 for calling a global function with example usage: get_doc_object(obj, what, doc, config) and returns: SphinxClassDoc, SphinxFunctionDoc, SphinxObjDoc