class_docstr: A global system that helps to manage the experiments.
class_docstr_tok: ["A","global","system","that","helps","to","manage","the","experiments","."]
docstr: Method for retrieving a recorder.
  
  - If `active recorder` exists:
  
      - no id or name specified, return the active recorder.
  
      - if id or name is specified, return the specified recorder.
  
  - If `active recorder` not exists:
  
      - no id or name specified, raise Error.
  
      - if id or name is specified, and the corresponding experiment_name must be given, return the specified recorder. Otherwise, raise Error.
  
  The recorder can be used for further process such as `save_object`, `load_object`, `log_params`,
  `log_metrics`, etc.
  
  Here are some use cases:
  
  .. code-block:: Python
  
      # Case 1
      with R.start(experiment_name='test'):
          recorder = R.get_recorder()
  
      # Case 2
      with R.start(experiment_name='test'):
          recorder = R.get_recorder(recorder_id='2e7a4efd66574fa49039e00ffaefa99d')
  
      # Case 3
      recorder = R.get_recorder() -> Error
  
      # Case 4
      recorder = R.get_recorder(recorder_id='2e7a4efd66574fa49039e00ffaefa99d') -> Error
  
      # Case 5
      recorder = R.get_recorder(recorder_id='2e7a4efd66574fa49039e00ffaefa99d', experiment_name='test')
  
  
  Here are some things users may concern
  - Q: What recorder will it return if multiple recorder meets the query (e.g. query with experiment_name)
  - A: If mlflow backend is used, then the recorder with the latest `start_time` will be returned. Because MLflow's `search_runs` function guarantee it
  
  Parameters
  ----------
  recorder_id : str
      id of the recorder.
  recorder_name : str
      name of the recorder.
  experiment_name : str
      name of the experiment.
  
  Returns
  -------
  A recorder instance.
docstr_tok: ["Method","for","retrieving","a","recorder",".","-","If","`","active","recorder","`","exists",":","-","no","id","or","name","specified",",","return","the","active","recorder",".","-","if","id","or","name","is","specified",",","return","the","specified","recorder",".","-","If","`","active","recorder","`","not","exists",":","-","no","id","or","name","specified",",","raise","Error",".","-","if","id","or","name","is","specified",",","and","the","corresponding","experiment_name","must","be","given",",","return","the","specified","recorder",".","Otherwise",",","raise","Error",".","The","recorder","can","be","used","for","further","process","such","as","`","save_object","`",",","`","load_object","`",",","`","log_params","`",",","`","log_metrics","`",",","etc",".","Here","are","some","use","cases",":","..","code-block",":",":","Python","#","Case","1","with","R.start","(","experiment_name='test","'",")",":","recorder","=","R.get_recorder","(",")","#","Case","2","with","R.start","(","experiment_name='test","'",")",":","recorder","=","R.get_recorder","(","recorder_id='2e7a4efd66574fa49039e00ffaefa99d","'",")","#","Case","3","recorder","=","R.get_recorder","(",")","-",">","Error","#","Case","4","recorder","=","R.get_recorder","(","recorder_id='2e7a4efd66574fa49039e00ffaefa99d","'",")","-",">","Error","#","Case","5","recorder","=","R.get_recorder","(","recorder_id='2e7a4efd66574fa49039e00ffaefa99d","'",",","experiment_name='test","'",")","Here","are","some","things","users","may","concern","-","Q",":","What","recorder","will","it","return","if","multiple","recorder","meets","the","query","(","e.g",".","query","with","experiment_name",")","-","A",":","If","mlflow","backend","is","used",",","then","the","recorder","with","the","latest","`","start_time","`","will","be","returned",".","Because","MLflow","'s","`","search_runs","`","function","guarantee","it","Parameters","--","--","--","--","--","recorder_id",":","str","id","of","the","recorder",".","recorder_name",":","str","name","of","the","recorder",".","experiment_name",":","str","name","of","the","experiment",".","Returns","--","--","--","-","A","recorder","instance","."]
code: def get_recorder(
      self,
      *,
      recorder_id=None,
      recorder_name=None,
      experiment_id=None,
      experiment_name=None,
  ) -> Recorder:
      """
      Method for retrieving a recorder.
  
      - If `active recorder` exists:
  
          - no id or name specified, return the active recorder.
  
          - if id or name is specified, return the specified recorder.
  
      - If `active recorder` not exists:
  
          - no id or name specified, raise Error.
  
          - if id or name is specified, and the corresponding experiment_name must be given, return the specified recorder. Otherwise, raise Error.
  
      The recorder can be used for further process such as `save_object`, `load_object`, `log_params`,
      `log_metrics`, etc.
  
      Here are some use cases:
  
      .. code-block:: Python
  
          # Case 1
          with R.start(experiment_name='test'):
              recorder = R.get_recorder()
  
          # Case 2
          with R.start(experiment_name='test'):
              recorder = R.get_recorder(recorder_id='2e7a4efd66574fa49039e00ffaefa99d')
  
          # Case 3
          recorder = R.get_recorder() -> Error
  
          # Case 4
          recorder = R.get_recorder(recorder_id='2e7a4efd66574fa49039e00ffaefa99d') -> Error
  
          # Case 5
          recorder = R.get_recorder(recorder_id='2e7a4efd66574fa49039e00ffaefa99d', experiment_name='test')
  
  
      Here are some things users may concern
      - Q: What recorder will it return if multiple recorder meets the query (e.g. query with experiment_name)
      - A: If mlflow backend is used, then the recorder with the latest `start_time` will be returned. Because MLflow's `search_runs` function guarantee it
  
      Parameters
      ----------
      recorder_id : str
          id of the recorder.
      recorder_name : str
          name of the recorder.
      experiment_name : str
          name of the experiment.
  
      Returns
      -------
      A recorder instance.
      """
      return self.get_exp(
          experiment_name=experiment_name,
          experiment_id=experiment_id,
          create=False,
      ).get_recorder(
          recorder_id, recorder_name, create=False, start=False
      )
  
imports: from contextlib import contextmanager
  from typing import Text, Optional, Any, Dict
  from .expm import ExpManager
  from .exp import Experiment
  from .recorder import Recorder
  from ..utils import Wrapper
  from ..utils.exceptions import RecorderInitializationError
  import sys
label_desc: Use image node_id 14 for calling the QlibRecorder obj's underlying member method code with example usage: obj.get_recorder() and returns: self