code: def _deprecate_arguments(
      *,
      version: str,
      deprecated_args: Iterable[str],
      custom_message: Optional[str] = None,
  ):
      """Decorator to issue warnings when using deprecated arguments.
  
      TODO: could be useful to be able to set a custom error message.
  
      Args:
          version (`str`):
              The version when deprecated arguments will result in error.
          deprecated_args (`List[str]`):
              List of the arguments to be deprecated.
          custom_message (`str`, *optional*):
              Warning message that is raised. If not passed, a default warning message
              will be created.
      """
  
      def _inner_deprecate_positional_args(f):
          sig = signature(f)
  
          @wraps(f)
          def inner_f(*args, **kwargs):
              # Check for used deprecated arguments
              used_deprecated_args = []
              for _, parameter in zip(args, sig.parameters.values()):
                  if parameter.name in deprecated_args:
                      used_deprecated_args.append(parameter.name)
              for kwarg_name, kwarg_value in kwargs.items():
                  if (
                      # If argument is deprecated but still used
                      kwarg_name in deprecated_args
                      # And then the value is not the default value
                      and kwarg_value
                      != sig.parameters[kwarg_name].default
                  ):
                      used_deprecated_args.append(kwarg_name)
  
              # Warn and proceed
              if len(used_deprecated_args) > 0:
                  message = (
                      f"Deprecated argument(s) used in '{f.__name__}':"
                      f" {', '.join(used_deprecated_args)}. Will not be supported from"
                      f" version '{version}'."
                  )
                  if custom_message is not None:
                      message += "\n\n" + custom_message
                  warnings.warn(message, FutureWarning)
              return f(*args, **kwargs)
  
          return inner_f
  
      return _inner_deprecate_positional_args
  
imports: import warnings
  from functools import wraps
  from inspect import Parameter, signature
  from typing import Iterable, Optional
label_desc: Use image node_id 2 for calling a global function with example usage: _deprecate_arguments() and returns: _inner_deprecate_positional_args, inner_f, f