class_docstr: Util class for setting up and logging to MLflow.
  
  Use this util for any library that needs MLflow logging/tracking logic
  such as Ray Tune or Ray Train.
class_docstr_tok: ["Util","class","for","setting","up","and","logging","to","MLflow",".","Use","this","util","for","any","library","that","needs","MLflow","logging\/tracking","logic","such","as","Ray","Tune","or","Ray","Train","."]
docstr: Logs the provided metrics to the run specified by run_id.
  
  
  If no ``run_id`` is passed in, then logs to the current active run.
  If there is not active run, then creates a new run and sets it as
  the active run.
  
  Args:
      metrics_to_log: Dictionary of metrics to log.
      run_id (Optional[str]): The ID of the run to log to.
docstr_tok: ["Logs","the","provided","metrics","to","the","run","specified","by","run_id",".","If","no","``","run_id","``","is","passed","in",",","then","logs","to","the","current","active","run",".","If","there","is","not","active","run",",","then","creates","a","new","run","and","sets","it","as","the","active","run",".","Args",":","metrics_to_log",":","Dictionary","of","metrics","to","log",".","run_id","(","Optional","[","str","]",")",":","The","ID","of","the","run","to","log","to","."]
code: def log_metrics(
      self, step, metrics_to_log: Dict, run_id: Optional[str] = None
  ):
      """Logs the provided metrics to the run specified by run_id.
  
  
      If no ``run_id`` is passed in, then logs to the current active run.
      If there is not active run, then creates a new run and sets it as
      the active run.
  
      Args:
          metrics_to_log: Dictionary of metrics to log.
          run_id (Optional[str]): The ID of the run to log to.
      """
      metrics_to_log = flatten_dict(metrics_to_log)
      metrics_to_log = self._parse_dict(metrics_to_log)
  
      if run_id and self._run_exists(run_id):
          client = self._get_client()
          for key, value in metrics_to_log.items():
              client.log_metric(
                  run_id=run_id, key=key, value=value, step=step
              )
  
      else:
          for key, value in metrics_to_log.items():
              self._mlflow.log_metric(key=key, value=value, step=step)
  
file_path: ray/python/ray/air/_internal/mlflow.py
imports: import logging
  import os
  from packaging import version
  from copy import deepcopy
  from typing import TYPE_CHECKING, Dict, Optional
  from ray._private.dict import flatten_dict
label_desc: Use image node_id 10 for calling the _MLflowLoggerUtil obj's underlying member method code with example usage: obj.log_metrics(step, metrics_to_log, run_id) without return types