code: def _deprecate_positional_args(f):
      """Decorator for methods that issues warnings for positional arguments
  
      Using the keyword-only argument syntax in pep 3102, arguments after the
      * will issue a warning when passed as a positional argument.
  
      Parameters
      ----------
      f : function
          function to check arguments on.
      """
      sig = signature(f)
      kwonly_args = []
      all_args = []
  
      for name, param in sig.parameters.items():
          if param.kind == Parameter.POSITIONAL_OR_KEYWORD:
              all_args.append(name)
          elif param.kind == Parameter.KEYWORD_ONLY:
              kwonly_args.append(name)
  
      @wraps(f)
      def inner_f(*args, **kwargs):
          extra_args = len(args) - len(all_args)
          if extra_args > 0:
              # ignore first 'self' argument for instance methods
              args_msg = [
                  f"{name}={arg}"
                  for name, arg in zip(
                      kwonly_args[:extra_args], args[-extra_args:]
                  )
              ]
              warnings.warn(
                  f"Pass {', '.join(args_msg)} as keyword args. From version 0.9 "
                  f"passing these as positional arguments will "
                  f"result in an error",
                  FutureWarning,
                  stacklevel=1,
              )
          kwargs.update(
              {k: arg for k, arg in zip(sig.parameters, args)}
          )
          return f(**kwargs)
  
      return inner_f
  
imports: import warnings
  from collections import OrderedDict
  from functools import wraps
  from inspect import Parameter, signature
  from numbers import Real
  from typing import Any, Dict
  import numpy
  from sklearn.utils import column_or_1d
  from sklearn.utils.multiclass import type_of_target
label_desc: Use image node_id 13 for calling a global function with example usage: _deprecate_positional_args(f) and returns: inner_f, f