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, config)
  
      if not self["Signature"] and func is not None:
          func, func_name = self.get_func()
          try:
              try:
                  signature = str(inspect.signature(func))
              except (AttributeError, ValueError):
                  # try to read signature, backward compat for older Python
                  if sys.version_info[0] >= 3:
                      argspec = inspect.getfullargspec(func)
                  else:
                      argspec = inspect.getargspec(func)
                  signature = inspect.formatargspec(*argspec)
              signature = f"{func_name}{signature}"
          except TypeError:
              signature = f"{func_name}()"
          self["Signature"] = signature
  
imports: import inspect
  import textwrap
  import re
  import pydoc
  from warnings import warn
  from collections import namedtuple
  from collections.abc import Callable, Mapping
  import copy
  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)