code: def argument_clinic(
      string, want_obj=False, want_context=False, want_arguments=False
  ):
      """
      Works like Argument Clinic (PEP 436), to validate function params.
      """
  
      def f(func):
          @repack_with_argument_clinic(
              string, keep_arguments_param=True
          )
          def wrapper(evaluator, obj, *args, **kwargs):
              arguments = kwargs.pop("arguments")
              assert not kwargs  # Python 2...
              debug.dbg("builtin start %s" % obj, color="MAGENTA")
              result = NO_CONTEXTS
              if want_context:
                  kwargs["context"] = arguments.context
              if want_obj:
                  kwargs["obj"] = obj
              if want_arguments:
                  kwargs["arguments"] = arguments
              result = func(evaluator, *args, **kwargs)
              debug.dbg("builtin end: %s", result, color="MAGENTA")
              return result
  
          return wrapper
  
      return f
  
imports: import parso
  from jedi._compatibility import force_unicode
  from jedi import debug
  from jedi.evaluate.arguments import ValuesArguments, repack_with_argument_clinic
  from jedi.evaluate import analysis
  from jedi.evaluate import compiled
  from jedi.evaluate.context.instance import AbstractInstanceContext, CompiledInstance, BoundMethod, InstanceArguments
  from jedi.evaluate.base_context import ContextualizedNode, NO_CONTEXTS, ContextSet
  from jedi.evaluate.context import ClassContext, ModuleContext, FunctionExecutionContext
  from jedi.evaluate.context import iterable
  from jedi.evaluate.lazy_context import LazyTreeContext
  from jedi.evaluate.syntax_tree import is_string
label_desc: Use image node_id 3 for calling a global function with example usage: argument_clinic(string, want_obj, want_context, want_arguments) and returns: f, wrapper, result