code: def testMlFlowLoggerLogging(self):
      clear_env_vars()
      trial_config = {"par1": "a", "par2": "b"}
      trial = MockTrial(trial_config, "trial1", 0, "artifact")
  
      logger = MLflowLoggerCallback(
          tracking_uri=self.tracking_uri,
          registry_uri=self.registry_uri,
          experiment_name="test1",
          save_artifact=True,
          tags={"hello": "world"},
      )
      logger.setup()
  
      # Check if run is created with proper tags.
      logger.on_trial_start(iteration=0, trials=[], trial=trial)
      all_runs = logger.mlflow_util._mlflow.search_runs(
          experiment_ids=["2"]
      )
      self.assertEqual(len(all_runs), 1)
      # all_runs is a pandas dataframe.
      all_runs = all_runs.to_dict(orient="records")
      run = logger.mlflow_util._mlflow.get_run(all_runs[0]["run_id"])
      self.assertDictEqual(
          run.data.tags,
          {
              "hello": "world",
              "trial_name": "trial1",
              "mlflow.runName": "trial1",
          },
      )
      self.assertEqual(logger._trial_runs[trial], run.info.run_id)
      # Params should be logged.
      self.assertDictEqual(run.data.params, trial_config)
  
      # When same trial is started again, new run should not be created.
      logger.on_trial_start(iteration=0, trials=[], trial=trial)
      all_runs = logger.mlflow_util._mlflow.search_runs(
          experiment_ids=["2"]
      )
      self.assertEqual(len(all_runs), 1)
  
      # Check metrics are logged properly.
      result = {
          "metric1": 0.8,
          "metric2": 1,
          "metric3": None,
          "training_iteration": 0,
      }
      logger.on_trial_result(0, [], trial, result)
      run = logger.mlflow_util._mlflow.get_run(run_id=run.info.run_id)
      # metric3 is not logged since it cannot be converted to float.
      self.assertDictEqual(
          run.data.metrics,
          {"metric1": 0.8, "metric2": 1.0, "training_iteration": 0},
      )
  
      # Check that artifact is logged on termination.
      logger.on_trial_complete(0, [], trial)
      self.assertTrue(logger.mlflow_util.artifact_saved)
      self.assertDictEqual(
          logger.mlflow_util.artifact_info,
          {"dir": "artifact", "run_id": run.info.run_id},
      )
  
imports: import os
  import shutil
  import tempfile
  import unittest
  from collections import namedtuple
  from unittest.mock import patch
  from mlflow.tracking import MlflowClient
  from ray._private.dict import flatten_dict
  from ray.train._internal.session import init_session, shutdown_session
  from ray.train._internal.storage import StorageContext
  from ray.air.integrations.mlflow import MLflowLoggerCallback, setup_mlflow, _NoopModule
  from ray.air._internal.mlflow import _MLflowLoggerUtil
label_desc: Use image node_id 4 for calling the MLflowTest obj's underlying member method code with example usage: obj.testMlFlowLoggerLogging() without return types