code: def default_doc_func(func, num, p):
      if func.__doc__ is None:
          return None
  
      all_args_with_values = parameterized_argument_value_pairs(func, p)
  
      # Assumes that the function passed is a bound method.
      descs = [
          "%s=%s" % (n, short_repr(v)) for n, v in all_args_with_values
      ]
  
      # The documentation might be a multiline string, so split it
      # and just work with the first string, ignoring the period
      # at the end if there is one.
      first, nl, rest = func.__doc__.lstrip().partition("\n")
      suffix = ""
      if first.endswith("."):
          suffix = "."
          first = first[:-1]
      args = "%s[with %s]" % (
          len(first) and " " or "",
          ", ".join(descs),
      )
      return "".join([first.rstrip(), args, suffix, nl, rest])
  
imports: import re
  import sys
  import inspect
  import warnings
  from functools import wraps
  from types import MethodType
  from collections import namedtuple
  from unittest import TestCase
label_desc: Use image node_id 3 for calling a global function with example usage: default_doc_func(func, num, p) and returns: str, None