code: def repack_with_argument_clinic(string, keep_arguments_param=False):
      """
      Transforms a function or method with arguments to the signature that is
      given as an argument clinic notation.
  
      Argument clinic is part of CPython and used for all the functions that are
      implemented in C (Python 3.7):
  
          str.split.__text_signature__
          # Results in: '($self, /, sep=None, maxsplit=-1)'
      """
      clinic_args = list(_parse_argument_clinic(string))
  
      def decorator(func):
          def wrapper(*args, **kwargs):
              if keep_arguments_param:
                  arguments = kwargs["arguments"]
              else:
                  arguments = kwargs.pop("arguments")
              try:
                  args += tuple(
                      _iterate_argument_clinic(arguments, clinic_args)
                  )
              except ValueError:
                  return NO_CONTEXTS
              else:
                  return func(*args, **kwargs)
  
          return wrapper
  
      return decorator
  
imports: import re
  from parso.python import tree
  from jedi._compatibility import zip_longest
  from jedi import debug
  from jedi.evaluate import analysis
  from jedi.evaluate.lazy_context import LazyKnownContext, LazyKnownContexts, LazyTreeContext, get_merged_lazy_context
  from jedi.evaluate.filters import ParamName
  from jedi.evaluate.base_context import NO_CONTEXTS
  from jedi.evaluate.context import iterable
  from jedi.evaluate.param import get_executed_params, ExecutedParam
label_desc: Use image node_id 2 for calling a global function with example usage: repack_with_argument_clinic(string, keep_arguments_param) and returns: decorator, wrapper, func, NO_CONTEXTS