code: def _handle_arg_deprecations(schema, kwargs, op_name):
      """Handle deprecation of the named arguments (scalar arguments and argument inputs) specified
      to the operator.
  
      Based on the schema information the argument can be automatically renamed or dropped
      with appropriate warnings being issued. Errors are raised if both the old and new name of
      renamed argument are used.
  
      Parameters
      ----------
      schema : OpSchema
          Schema for the operator containing the deprecation information.
      kwargs : Dict
          Dictionary containing the arguments.
      op_name : str
          Name of the invoked operator, for error reporting purposes.
  
      Returns
      -------
      Dict
          Dictionary with arguments rearranged
      """
      arg_names = list(kwargs.keys())
      for arg_name in arg_names:
          if not schema.IsDeprecatedArg(arg_name):
              continue
          meta = schema.DeprecatedArgMeta(arg_name)
          new_name = meta["renamed_to"]
          removed = meta["removed"]
          msg = meta["msg"]
          if new_name:
              if new_name in kwargs:
                  raise TypeError(
                      f"Operator {op_name} got an unexpected '{arg_name}' deprecated"
                      f" argument when '{new_name}' was already provided"
                  )
              kwargs[new_name] = kwargs[arg_name]
              del kwargs[arg_name]
          elif removed:
              del kwargs[arg_name]
  
          with warnings.catch_warnings():
              warnings.simplefilter("default")
              warnings.warn(msg, DeprecationWarning, stacklevel=2)
      return kwargs
  
imports: import sys
  import threading
  import tree
  import warnings
  from itertools import count
  import nvidia.dali.python_function_plugin
  from nvidia.dali import backend
  from nvidia.dali import fn
  from nvidia.dali import internal
  from nvidia.dali.data_node import DataNode
  from nvidia.dali.pipeline import Pipeline
  from nvidia.dali.types import _type_name_convert_to_string, _type_convert_value, _default_converter, _vector_element_type, ScalarConstant, Constant
  from nvidia.dali import _conditionals
  from nvidia.dali.ops import _registry, _names, _docs, _operator_utils
  from nvidia.dali.ops._registry import cpu_ops, mixed_ops, gpu_ops, register_cpu_op, register_gpu_op
  from nvidia.dali.ops._names import _op_name, _process_op_name, _schema_name
  from nvidia.dali.ops._operator_utils import _build_input_sets, _repack_output_sets
  from nvidia.dali.external_source import ExternalSource
  from nvidia.dali.ops._operators.python_function import PythonFunctionBase, PythonFunction, DLTensorPythonFunction, _dlpack_to_array, _dlpack_from_array
  from nvidia.dali.ops._operators.compose import Compose
  from nvidia.dali.ops._operators.math import _arithm_op, _group_inputs, _generate_input_desc
label_desc: Use image node_id 4 for calling a global function with example usage: _handle_arg_deprecations(schema, kwargs, op_name) and returns: kwargs