code: def print_function(print_cls):
      """A decorator to replace kwargs with the printer settings in __signature__"""
  
      def decorator(f):
          if sys.version_info < (3, 9):
              # We have to create a subclass so that `help` actually shows the docstring in older Python versions.
              # IPython and Sphinx do not need this, only a raw Python console.
              cls = type(
                  f"{f.__qualname__}_PrintFunction",
                  (_PrintFunction,),
                  {"__doc__": f.__doc__},
              )
          else:
              cls = _PrintFunction
          return cls(f, print_cls)
  
      return decorator
  
imports: from __future__ import annotations
  import sys
  from typing import Any, Type
  import inspect
  from contextlib import contextmanager
  from functools import cmp_to_key, update_wrapper
  from sympy.core.add import Add
  from sympy.core.basic import Basic
  from sympy.core.function import AppliedUndef, UndefinedFunction, Function
label_desc: Use image node_id 2 for calling a global function with example usage: print_function(print_cls) and returns: decorator, cls