code: def test_universal_autolog_attaches_pyspark_import_hook_in_non_databricks(
      config,
  ):
      with mock.patch(
          "mlflow.spark.autolog",
          wraps=mlflow.spark.autolog,
          autospec=True,
      ) as autolog_mock:
          autolog_mock.integration_name = "spark"
  
          mlflow.autolog(**config)
          autolog_mock.assert_not_called()
  
          mlflow.utils.import_hooks.notify_module_loaded(pyspark)
  
          # assert autolog is called once pyspark is imported
          autolog_mock.assert_called_once_with(**config, silent=False)
  
imports: import sys
  from collections import namedtuple
  from io import StringIO
  from unittest import mock
  import fastai
  import lightgbm
  import pyspark
  import pyspark.ml
  import pytest
  import pytorch_lightning
  import setfit
  import sklearn
  import statsmodels
  import tensorflow
  import transformers
  import xgboost
  import mlflow
  from mlflow.utils.autologging_utils import AutologgingEventLogger, autologging_is_disabled, get_autologging_config
  from tests.autologging.fixtures import reset_stderr, test_mode_off, test_mode_on
label_desc: Use image node_id 8 for calling a global function with example usage: test_universal_autolog_attaches_pyspark_import_hook_in_non_databricks(config) without return types