class_docstr: This is the `Experiment` class for each experiment being run. The API is designed similar to mlflow.
  (The link: https://mlflow.org/docs/latest/python_api/mlflow.html)
class_docstr_tok: ["This","is","the","`","Experiment","`","class","for","each","experiment","being","run",".","The","API","is","designed","similar","to","mlflow",".","(","The","link",":","https",":","\/\/mlflow.org\/docs\/latest\/python_api\/mlflow.html",")"]
docstr: Method for getting or creating a recorder. It will try to first get a valid recorder, if exception occurs, it will
  automatically create a new recorder based on the given id and name.
docstr_tok: ["Method","for","getting","or","creating","a","recorder",".","It","will","try","to","first","get","a","valid","recorder",",","if","exception","occurs",",","it","will","automatically","create","a","new","recorder","based","on","the","given","id","and","name","."]
code: def _get_or_create_rec(
      self, recorder_id=None, recorder_name=None
  ) -> (object, bool):
      """
      Method for getting or creating a recorder. It will try to first get a valid recorder, if exception occurs, it will
      automatically create a new recorder based on the given id and name.
      """
      try:
          if recorder_id is None and recorder_name is None:
              recorder_name = self._default_rec_name
          return (
              self._get_recorder(
                  recorder_id=recorder_id, recorder_name=recorder_name
              ),
              False,
          )
      except ValueError:
          if recorder_name is None:
              recorder_name = self._default_rec_name
          logger.info(
              f"No valid recorder found. Create a new recorder with name {recorder_name}."
          )
          return self.create_recorder(recorder_name), True
  
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 11 for calling the Experiment obj's underlying member method code with example usage: obj._get_or_create_rec(recorder_id, recorder_name) and returns: self,  False, self,  True