code: def train(uri_path: str = None):
      """train model
  
      Returns
      -------
          pred_score: pandas.DataFrame
              predict scores
          performance: dict
              model performance
      """
  
      # model initiaiton
      model = init_instance_by_config(CSI300_GBDT_TASK["model"])
      dataset = init_instance_by_config(CSI300_GBDT_TASK["dataset"])
      # To test __repr__
      print(dataset)
      print(R)
  
      # start exp
      with R.start(experiment_name="workflow", uri=uri_path):
          R.log_params(**flatten_dict(CSI300_GBDT_TASK))
          model.fit(dataset)
          R.save_objects(trained_model=model)
          # prediction
          recorder = R.get_recorder()
          # To test __repr__
          print(recorder)
          # To test get_local_dir
          print(recorder.get_local_dir())
          rid = recorder.id
          sr = SignalRecord(model, dataset, recorder)
          sr.generate()
          pred_score = sr.load("pred.pkl")
  
          # calculate ic and ric
          sar = SigAnaRecord(recorder)
          sar.generate()
          ic = sar.load("ic.pkl")
          ric = sar.load("ric.pkl")
  
          uri_path = R.get_uri()
      return pred_score, {"ic": ic, "ric": ric}, rid, uri_path
  
imports: import sys
  import shutil
  import unittest
  import pytest
  from pathlib import Path
  import qlib
  from qlib.config import C
  from qlib.utils import init_instance_by_config, flatten_dict
  from qlib.workflow import R
  from qlib.workflow.record_temp import SignalRecord, SigAnaRecord, PortAnaRecord
  from qlib.tests import TestAutoData
  from qlib.tests.config import CSI300_GBDT_TASK, CSI300_BENCH
label_desc: Use image node_id 1 for calling a global function with example usage: train(uri_path) and returns: pred_score,  dict,  rid,  uri_path