code: def _render_signature(obj_signature, obj_name) -> str:
      """
      This was mostly taken from inspect.Signature.__str__.
      Look there for the comments.
      The only change is to add linebreaks when this gets too long.
      """
      result = []
      pos_only = False
      kw_only = True
      for param in obj_signature.parameters.values():
          if param.kind == inspect.Parameter.POSITIONAL_ONLY:
              pos_only = True
          elif pos_only:
              result.append("/")
              pos_only = False
  
          if param.kind == inspect.Parameter.VAR_POSITIONAL:
              kw_only = False
          elif param.kind == inspect.Parameter.KEYWORD_ONLY and kw_only:
              result.append("*")
              kw_only = False
  
          result.append(str(param))
  
      if pos_only:
          result.append("/")
  
      # add up name, parameters, braces (2), and commas
      if len(obj_name) + sum(len(r) + 2 for r in result) > 75:
          # This doesn’t fit behind “Signature: ” in an inspect window.
          rendered = "{}(\n{})".format(
              obj_name, "".join("    {},\n".format(r) for r in result)
          )
      else:
          rendered = "{}({})".format(obj_name, ", ".join(result))
  
      if obj_signature.return_annotation is not inspect._empty:
          anno = inspect.formatannotation(
              obj_signature.return_annotation
          )
          rendered += " -> {}".format(anno)
  
      return rendered
  
imports: from dataclasses import dataclass
  from inspect import signature
  from textwrap import dedent
  import ast
  import html
  import inspect
  import io
  import linecache
  import os
  import sys
  import types
  import warnings
  from typing import Any, Optional, Dict, Union, List, Tuple
  from typing import TypeAlias
  from IPython.core import page
  from IPython.lib.pretty import pretty
  from IPython.testing.skipdoctest import skip_doctest
  from IPython.utils import PyColorize
  from IPython.utils import openpy
  from IPython.utils.dir2 import safe_hasattr
  from IPython.utils.path import compress_user
  from IPython.utils.text import indent
  from IPython.utils.wildcard import list_namespace
  from IPython.utils.wildcard import typestr2type
  from IPython.utils.coloransi import TermColors, ColorScheme, ColorSchemeTable
  from IPython.utils.py3compat import cast_unicode
  from IPython.utils.colorable import Colorable
  from IPython.utils.decorators import undoc
  from pygments import highlight
  from pygments.lexers import PythonLexer
  from pygments.formatters import HtmlFormatter
label_desc: Use image node_id 13 for calling a global function with example usage: _render_signature(obj_signature, obj_name) and returns: rendered