code: def test_client_can_be_serialized_with_pickle(tmp_path):
      """
      Verifies that instances of `MlflowClient` can be serialized using pickle, even if the underlying
      Tracking and Model Registry stores used by the client are not serializable using pickle
      """
  
      class MockUnpickleableTrackingStore(SqlAlchemyTrackingStore):
          pass
  
      class MockUnpickleableModelRegistryStore(
          SqlAlchemyModelRegistryStore
      ):
          pass
  
      backend_store_path = tmp_path.joinpath("test.db")
      artifact_store_path = tmp_path.joinpath("artifacts")
  
      mock_tracking_store = MockUnpickleableTrackingStore(
          f"sqlite:///{backend_store_path}", str(artifact_store_path)
      )
      mock_model_registry_store = MockUnpickleableModelRegistryStore(
          f"sqlite:///{backend_store_path}"
      )
  
      # Verify that the mock stores cannot be pickled because they are defined within a function
      # (i.e. the test function)
      with pytest.raises(
          AttributeError,
          match="<locals>.MockUnpickleableTrackingStore'",
      ):
          pickle.dumps(mock_tracking_store)
  
      with pytest.raises(
          AttributeError,
          match="<locals>.MockUnpickleableModelRegistryStore'",
      ):
          pickle.dumps(mock_model_registry_store)
  
      _tracking_store_registry.register(
          "pickle", lambda *args, **kwargs: mock_tracking_store
      )
      _get_model_registry_store_registry().register(
          "pickle", lambda *args, **kwargs: mock_model_registry_store
      )
  
      # Create an MlflowClient with the store that cannot be pickled, perform
      # tracking & model registry operations, and verify that the client can still be pickled
      client = MlflowClient("pickle://foo")
      client.create_experiment("test_experiment")
      client.create_registered_model("test_model")
      pickle.dumps(client)
  
imports: import pickle
  from unittest import mock
  import pytest
  from mlflow import MlflowClient
  from mlflow.entities import ExperimentTag, Run, RunInfo, RunStatus, RunTag, SourceType, ViewType
  from mlflow.entities.metric import Metric
  from mlflow.entities.model_registry import ModelVersion, ModelVersionTag
  from mlflow.entities.model_registry.model_version_status import ModelVersionStatus
  from mlflow.entities.param import Param
  from mlflow.exceptions import MlflowException
  from mlflow.store.model_registry.sqlalchemy_store import SqlAlchemyStore
  from mlflow.store.tracking import SEARCH_MAX_RESULTS_DEFAULT
  from mlflow.store.tracking.sqlalchemy_store import SqlAlchemyStore
  from mlflow.tracking import set_registry_uri
  from mlflow.tracking._model_registry import DEFAULT_AWAIT_MAX_SLEEP_SECONDS
  from mlflow.tracking._model_registry.utils import _get_store_registry
  from mlflow.tracking._tracking_service.utils import _tracking_store_registry
  from mlflow.utils.databricks_utils import _construct_databricks_run_url, get_databricks_runtime
  from mlflow.utils.mlflow_tags import MLFLOW_GIT_COMMIT, MLFLOW_PARENT_RUN_ID, MLFLOW_PROJECT_ENTRY_POINT, MLFLOW_SOURCE_NAME, MLFLOW_SOURCE_TYPE, MLFLOW_USER
label_desc: Use image node_id 42 for calling a global function with example usage: test_client_can_be_serialized_with_pickle(tmp_path) without return types