code: def __init__(self, func, role="func", doc=None, config={}):
      self._f = func
      self._role = role  # e.g. "func" or "meth"
  
      if doc is None:
          if func is None:
              raise ValueError("No function or docstring given")
          doc = inspect.getdoc(func) or ""
      NumpyDocString.__init__(self, doc)
  
      if not self["Signature"] and func is not None:
          func, func_name = self.get_func()
          try:
              # try to read signature
              if sys.version_info[0] >= 3:
                  argspec = inspect.getfullargspec(func)
              else:
                  argspec = inspect.getargspec(func)
              argspec = inspect.formatargspec(*argspec)
              argspec = argspec.replace("*", "\*")
              signature = "%s%s" % (func_name, argspec)
          except TypeError as e:
              signature = "%s()" % func_name
          self["Signature"] = signature
  
imports: import inspect
  import textwrap
  import re
  import pydoc
  from warnings import warn
  import collections
  import sys
label_desc: Use image node_id 1 to create a new FunctionDoc object from inherited base classes: NumpyDocString with example: obj = FunctionDoc(func, role, doc, config)