code: def _validate_args(
      autologging_integration,
      function_name,
      user_call_args,
      user_call_kwargs,
      autologging_call_args,
      autologging_call_kwargs,
  ):
      """
      Used for testing purposes to verify that, when a patched ML function calls its underlying
      / original ML function, the following properties are satisfied:
  
          - All arguments supplied to the patched ML function are forwarded to the
            original ML function
          - Any additional arguments supplied to the original function are exception safe (i.e.
            they are either functions decorated with the `@exception_safe_function_for_class` or
            `@pickalable_exception_safe_function` decorators, or classes / instances of classes with
            type `ExceptionSafeClass`
      """
  
      def _validate_new_input(inp):
          """
          Validates a new input (arg or kwarg) introduced to the underlying / original ML function
          call during the execution of a patched ML function. The new input is valid if:
  
              - The new input is a function that has been decorated with
                `exception_safe_function_for_class` or `pickalable_exception_safe_function`
              - OR the new input is a class with the `ExceptionSafeClass` metaclass
              - OR the new input is a list and each of its elements is valid according to the
                these criteria
          """
          if type(inp) == list:
              for item in inp:
                  _validate_new_input(item)
          elif callable(inp):
              assert getattr(inp, _ATTRIBUTE_EXCEPTION_SAFE, False), (
                  f"New function argument '{inp}' passed to original function is not exception-safe."
                  " Please decorate the function with `exception_safe_function` or "
                  "`pickalable_exception_safe_function`"
              )
          else:
              assert hasattr(inp, "__class__") and type(
                  inp.__class__
              ) in [
                  ExceptionSafeClass,
                  ExceptionSafeAbstractClass,
              ], (
                  f"Invalid new input '{inp}'. New args / kwargs introduced to `original` function "
                  "calls by patched code must either be functions decorated with "
                  "`exception_safe_function_for_class`, instances of classes with the "
                  "`ExceptionSafeClass` or `ExceptionSafeAbstractClass` metaclass safe or lists of "
                  "such exception safe functions / classes."
              )
  
      def _assert_autologging_input_positional_args_are_superset(
          autologging_call_input, user_call_input
      ):
          length_diff = len(autologging_call_input) - len(
              user_call_input
          )
          assert (
              length_diff >= 0
          ), f"{length_diff} expected inputs are missing from the call to the original function."
  
      def _assert_autologging_input_kwargs_are_superset(
          autologging_call_input, user_call_input
      ):
          assert set(user_call_input.keys()).issubset(
              set(autologging_call_input.keys())
          ), (
              "Keyword or dictionary arguments to original function omit"
              " one or more expected keys: '{}'".format(
                  set(user_call_input.keys())
                  - set(autologging_call_input.keys())
              )
          )
  
      def _validate(autologging_call_input, user_call_input=None):
          """
          Validates that the specified `autologging_call_input` and `user_call_input`
          are compatible. If `user_call_input` is `None`, then `autologging_call_input`
          is regarded as a new input added by autologging and is validated using
          `_validate_new_input`. Otherwise, the following properties must hold:
  
              - `autologging_call_input` and `user_call_input` must have the same type
                (referred to as "input type")
              - if the input type is a tuple, list or dictionary, then `autologging_call_input` must
                be equivalent to `user_call_input` or be a superset of `user_call_input`
              - for all other input types, `autologging_call_input` and `user_call_input`
                must be equivalent by reference equality or by object equality
  
          Args:
              autologging_call_input: call input from autologging.
              user_call_input: call input from user.
          """
  
          if (
              user_call_input is None
              and autologging_call_input is not None
          ):
              _validate_new_input(autologging_call_input)
              return
  
          assert type(autologging_call_input) == type(
              user_call_input
          ), "Type of input to original function '{}' does not match expected type '{}'".format(
              type(autologging_call_input), type(user_call_input)
          )
  
          if type(autologging_call_input) in [list, tuple]:
              _assert_autologging_input_positional_args_are_superset(
                  autologging_call_input, user_call_input
              )
              # If the autologging call input is longer than the user call input, we `zip_longest`
              # will pad the user call input with `None` values to ensure that the subsequent calls
              # to `_validate` identify new inputs added by the autologging call
              for a, u in itertools.zip_longest(
                  autologging_call_input, user_call_input
              ):
                  _validate(a, u)
          elif type(autologging_call_input) == dict:
              _assert_autologging_input_kwargs_are_superset(
                  autologging_call_input, user_call_input
              )
              for key in autologging_call_input.keys():
                  _validate(
                      autologging_call_input[key],
                      user_call_input.get(key, None),
                  )
          else:
              assert (
                  autologging_call_input is user_call_input
                  or autologging_call_input == user_call_input
              ), (
                  "Input to original function does not match expected input."
                  f" Original: '{autologging_call_input}'. Expected: '{user_call_input}'"
              )
  
      # Similar validation logic found in _validate, unraveling the list of arguments to exclude
      # checks for any validation exempt positional arguments.
      _assert_autologging_input_positional_args_are_superset(
          autologging_call_args, user_call_args
      )
      for (
          index,
          autologging_call_arg,
          user_call_arg,
      ) in itertools.zip_longest(
          range(len(user_call_args)),
          autologging_call_args,
          user_call_args,
      ):
          if not _is_arg_exempt_from_validation(
              autologging_integration,
              function_name,
              user_call_arg,
              argument_index=index,
          ):
              _validate(autologging_call_arg, user_call_arg)
  
      # Similar validation logic found in _validate, unraveling the dictionary of arguments to exclude
      # checks for any validation exempt keyword arguments.
      _assert_autologging_input_kwargs_are_superset(
          autologging_call_kwargs, user_call_kwargs
      )
      for key in autologging_call_kwargs.keys():
          if not _is_arg_exempt_from_validation(
              autologging_integration,
              function_name,
              user_call_kwargs.get(key, None),
              argument_name=key,
          ):
              _validate(
                  autologging_call_kwargs[key],
                  user_call_kwargs.get(key, None),
              )
  
imports: import abc
  import functools
  import inspect
  import itertools
  import typing
  import uuid
  from abc import abstractmethod
  from contextlib import contextmanager
  import mlflow
  import mlflow.utils.autologging_utils
  from mlflow.entities.run_status import RunStatus
  from mlflow.environment_variables import _MLFLOW_AUTOLOGGING_TESTING
  from mlflow.tracking.client import MlflowClient
  from mlflow.utils import gorilla, is_iterator
  from mlflow.utils.autologging_utils import _logger
  from mlflow.utils.autologging_utils.events import AutologgingEventLogger
  from mlflow.utils.autologging_utils.logging_and_warnings import set_mlflow_events_and_warnings_behavior_globally, set_non_mlflow_warnings_behavior_for_current_thread
  from mlflow.utils.mlflow_tags import MLFLOW_AUTOLOGGING
label_desc: Use image node_id 14 for calling a global function with example usage: _validate_args(autologging_integration, function_name, user_call_args, user_call_kwargs, autologging_call_args, autologging_call_kwargs) without return types