code: def task_train(
      task_config: dict, experiment_name: str, recorder_name: str = None
  ) -> Recorder:
      """
      Task based training, will be divided into two steps.
  
      Parameters
      ----------
      task_config : dict
          The config of a task.
      experiment_name: str
          The name of experiment
      recorder_name: str
          The name of recorder
  
      Returns
      ----------
      Recorder: The instance of the recorder
      """
      with R.start(
          experiment_name=experiment_name, recorder_name=recorder_name
      ):
          _log_task_info(task_config)
          _exe_task(task_config)
          return R.get_recorder()
  
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 5 for calling a global function with example usage: task_train(task_config, experiment_name, recorder_name) and returns: R