class_docstr: Use mlflow to implement Experiment.
class_docstr_tok: ["Use","mlflow","to","implement","Experiment","."]
docstr: Method for getting or creating a recorder. It will try to first get a valid recorder, if exception occurs, it will
  raise errors.
  
  Quoting docs of search_runs from MLflow
  > The default ordering is to sort by start_time DESC, then run_id.
docstr_tok: ["Method","for","getting","or","creating","a","recorder",".","It","will","try","to","first","get","a","valid","recorder",",","if","exception","occurs",",","it","will","raise","errors",".","Quoting","docs","of","search_runs","from","MLflow",">","The","default","ordering","is","to","sort","by","start_time","DESC",",","then","run_id","."]
code: def _get_recorder(self, recorder_id=None, recorder_name=None):
      """
      Method for getting or creating a recorder. It will try to first get a valid recorder, if exception occurs, it will
      raise errors.
  
      Quoting docs of search_runs from MLflow
      > The default ordering is to sort by start_time DESC, then run_id.
      """
      assert (
          recorder_id is not None or recorder_name is not None
      ), "Please input at least one of recorder id or name before retrieving recorder."
      if recorder_id is not None:
          try:
              run = self._client.get_run(recorder_id)
              recorder = MLflowRecorder(
                  self.id, self._uri, mlflow_run=run
              )
              return recorder
          except MlflowException as mlflow_exp:
              raise ValueError(
                  "No valid recorder has been found, please make sure the input recorder id is correct."
              ) from mlflow_exp
      elif recorder_name is not None:
          logger.warning(
              f"Please make sure the recorder name {recorder_name} is unique, we will only return the latest recorder if there exist several matched the given name."
          )
          recorders = self.list_recorders()
          for rid in recorders:
              if recorders[rid].name == recorder_name:
                  return recorders[rid]
          raise ValueError(
              "No valid recorder has been found, please make sure the input recorder name is correct."
          )
  
imports: from typing import Dict, List, Union
  from qlib.typehint import Literal
  import mlflow
  from mlflow.entities import ViewType
  from mlflow.exceptions import MlflowException
  from .recorder import Recorder, MLflowRecorder
  from ..log import get_module_logger
label_desc: Use image node_id 6 for calling the MLflowExperiment obj's underlying member method code with example usage: obj._get_recorder(recorder_id, recorder_name) and returns: recorder, recorders