class_docstr: Trainer based on (R)ecorder.
  It will train a list of tasks and return a list of model recorders in a linear way.
  
  Assumption: models were defined by `task` and the results will be saved to `Recorder`.
class_docstr_tok: ["Trainer","based","on","(","R",")","ecorder",".","It","will","train","a","list","of","tasks","and","return","a","list","of","model","recorders","in","a","linear","way",".","Assumption",":","models","were","defined","by","`","task","`","and","the","results","will","be","saved","to","`","Recorder","`","."]
docstr: Init TrainerR.
  
  Args:
      experiment_name (str, optional): the default name of experiment.
      train_func (Callable, optional): default training method. Defaults to `task_train`.
      call_in_subproc (bool): call the process in subprocess to force memory release
docstr_tok: ["Init","TrainerR",".","Args",":","experiment_name","(","str",",","optional",")",":","the","default","name","of","experiment",".","train_func","(","Callable",",","optional",")",":","default","training","method",".","Defaults","to","`","task_train","`",".","call_in_subproc","(","bool",")",":","call","the","process","in","subprocess","to","force","memory","release"]
code: def __init__(
      self,
      experiment_name: Optional[str] = None,
      train_func: Callable = task_train,
      call_in_subproc: bool = False,
      default_rec_name: Optional[str] = None,
  ):
      """
      Init TrainerR.
  
      Args:
          experiment_name (str, optional): the default name of experiment.
          train_func (Callable, optional): default training method. Defaults to `task_train`.
          call_in_subproc (bool): call the process in subprocess to force memory release
      """
      super().__init__()
      self.experiment_name = experiment_name
      self.default_rec_name = default_rec_name
      self.train_func = train_func
      self._call_in_subproc = call_in_subproc
  
imports: import socket
  from typing import Callable, List, Optional
  from tqdm.auto import tqdm
  from qlib.config import C
  from qlib.data.dataset import Dataset
  from qlib.data.dataset.weight import Reweighter
  from qlib.log import get_module_logger
  from qlib.model.base import Model
  from qlib.utils import auto_filter_kwargs, fill_placeholder, flatten_dict, init_instance_by_config
  from qlib.utils.paral import call_in_subproc
  from qlib.workflow import R
  from qlib.workflow.recorder import Recorder
  from qlib.workflow.task.manage import TaskManager, run_task
label_desc: Use image node_id 1 to create a new TrainerR object from inherited base classes: Trainer with example: obj = TrainerR(experiment_name, train_func, call_in_subproc, default_rec_name)