code: def mlflow_mock(monkeypatch):
      mlflow = ModuleType("mlflow")
      mlflow.set_tracking_uri = Mock()
      monkeypatch.setitem(sys.modules, "mlflow", mlflow)
  
      mlflow_tracking = ModuleType("tracking")
      mlflow_tracking.MlflowClient = Mock()
      mlflow_tracking.artifact_utils = Mock()
      monkeypatch.setitem(
          sys.modules, "mlflow.tracking", mlflow_tracking
      )
  
      mlflow_entities = ModuleType("entities")
      mlflow_entities.Metric = Mock()
      mlflow_entities.Param = Mock()
      mlflow_entities.time = Mock()
      monkeypatch.setitem(
          sys.modules, "mlflow.entities", mlflow_entities
      )
  
      mlflow.tracking = mlflow_tracking
      mlflow.entities = mlflow_entities
  
      monkeypatch.setattr(
          "lightning.pytorch.loggers.mlflow._MLFLOW_AVAILABLE", True
      ),
      return mlflow
  
file_path: pytorch-lightning/tests/tests_pytorch/loggers/conftest.py
imports: import sys
  from types import ModuleType
  from unittest.mock import MagicMock, Mock
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: mlflow_mock(monkeypatch) and returns: mlflow