code: def add_port_docs(wrapped=None, instance=None, value=""):
      if wrapped is None:
          return functools.partial(add_port_docs, value=value)
  
      @wrapt.decorator
      def wrapper(wrapped, instance=None, args=None, kwargs=None):
          return wrapped(*args, **kwargs)
  
      decorated = wrapper(wrapped)
      try:
          port_2_ntype = decorated(instance)
      except:
          port_2_ntype = None
  
      port_description = ""
      if port_2_ntype is not None:
          for port, ntype in port_2_ntype.items():
              port_description += "* *" + port + "* : " + str(ntype)
              port_description += "\n\n"
  
      __doc__ = (
          _normalize_docstring(wrapped.__doc__)
          + "\n\n"
          + str(port_description)
      )
      __doc__ = _normalize_docstring(__doc__)
  
      wrapt.FunctionWrapper.__setattr__(decorated, "__doc__", __doc__)
  
      return decorated
  
imports: import functools
  import sys
  import wrapt
label_desc: Use image node_id 2 for calling a global function with example usage: add_port_docs(wrapped, instance, value) and returns: decorated, functools, wrapped