code: def test_autologging_integration_makes_expected_event_logging_calls():
      @autologging_integration("test_success")
      def autolog_success(foo, bar=7, disable=False, silent=False):
          pass
  
      @autologging_integration("test_failure")
      def autolog_failure(biz, baz="val", disable=False, silent=False):
          raise Exception("autolog failed")
  
      class TestLogger(AutologgingEventLogger):
          LoggerCall = namedtuple(
              "LoggerCall", ["integration", "call_args", "call_kwargs"]
          )
  
          def __init__(self):
              self.calls = []
  
          def reset(self):
              self.calls = []
  
          def log_autolog_called(
              self, integration, call_args, call_kwargs
          ):
              self.calls.append(
                  TestLogger.LoggerCall(
                      integration, call_args, call_kwargs
                  )
              )
  
      logger = TestLogger()
      AutologgingEventLogger.set_logger(logger)
  
      autolog_success("a", bar=9, disable=True)
      assert len(logger.calls) == 1
      call = logger.calls[0]
      assert call.integration == "test_success"
      # NB: In MLflow > 1.13.1, the `call_args` argument to `log_autolog_called` is deprecated.
      # Positional arguments passed to `autolog()` should be forwarded to `log_autolog_called`
      # in keyword format
      assert call.call_args == ()
      assert call.call_kwargs == {
          "foo": "a",
          "bar": 9,
          "disable": True,
          "silent": False,
      }
  
      logger.reset()
  
      with pytest.raises(Exception, match="autolog failed"):
          autolog_failure(82, disable=False, silent=True)
      assert len(logger.calls) == 1
      call = logger.calls[0]
      assert call.integration == "test_failure"
      # NB: In MLflow > 1.13.1, the `call_args` argument to `log_autolog_called` is deprecated.
      # Positional arguments passed to `autolog()` should be forwarded to `log_autolog_called`
      # in keyword format
      assert call.call_args == ()
      assert call.call_kwargs == {
          "biz": 82,
          "baz": "val",
          "disable": False,
          "silent": True,
      }
  
imports: import inspect
  import sys
  import time
  from collections import namedtuple
  from unittest import mock
  import pytest
  import mlflow
  from mlflow import MlflowClient
  from mlflow.utils import gorilla
  from mlflow.utils.autologging_utils import AUTOLOGGING_INTEGRATIONS, AutologgingEventLogger, BatchMetricsLogger, autologging_integration, autologging_is_disabled, batch_metrics_logger, get_autologging_config, get_instance_method_first_arg_value, get_method_call_arg_value, log_fn_args_as_params, resolve_input_example_and_signature
  from mlflow.utils.autologging_utils.safety import AutologgingSession, _wrap_patch
  from mlflow.utils.autologging_utils.versioning import FLAVOR_TO_MODULE_NAME_AND_VERSION_INFO_KEY, _check_version_in_range, _is_pre_or_dev_release, _strip_dev_version_suffix, _violates_pep_440, is_flavor_supported_for_associated_package_versions
  from tests.autologging.fixtures import test_mode_off
label_desc: Use image node_id 27 for calling a global function with example usage: test_autologging_integration_makes_expected_event_logging_calls() without return types