code: def mock_mlflow_run_creation(
      logger, experiment_name=None, experiment_id=None, run_id=None
  ):
      """Helper function to simulate mlflow client creating a new (or existing) experiment."""
      run = MagicMock()
      run.info.run_id = run_id
      logger._mlflow_client.get_experiment_by_name = MagicMock(
          return_value=experiment_name
      )
      logger._mlflow_client.create_experiment = MagicMock(
          return_value=experiment_id
      )
      logger._mlflow_client.create_run = MagicMock(return_value=run)
      return logger
  
imports: import os
  from unittest import mock
  from unittest.mock import MagicMock, Mock
  import pytest
  from lightning.pytorch import Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.loggers.mlflow import _MLFLOW_AVAILABLE, MLFlowLogger, _get_resolve_tags
label_desc: Use image node_id 1 for calling a global function with example usage: mock_mlflow_run_creation(logger, experiment_name, experiment_id, run_id) and returns: logger