class_docstr: The motivation of Rolling Module
  - It only focus **offlinely** turn a specific task to rollinng
  - To make the implementation easier, following factors are ignored.
      - The tasks is dependent (e.g. time series).
  
  Related modules and difference from me:
  - MetaController: It is learning how to handle a task (e.g. learning to learn).
      - But rolling is about how to split a single task into tasks in time series and run them.
  - OnlineStrategy: It is focusing on serving a model, the model can be updated time dependently in time.
      - Rolling is much simpler and is only for testing rolling models offline. It does not want to share the interface with OnlineStrategy.
  
  The code about rolling is shared in `task_generator` & `RollingGen` level between me and the above modules
  But it is for different purpose, so other parts are not shared.
  
  
  .. code-block:: shell
  
      # here is an typical use case of the module.
      python -m qlib.contrib.rolling.base --conf_path <path to the yaml> run
  
  **NOTE**
  before running the example, please clean your previous results with following command
  - `rm -r mlruns`
  - Because it is very hard to permanently delete a experiment (it will be moved into .trash and raise error when creating experiment with same name).
class_docstr_tok: ["The","motivation","of","Rolling","Module","-","It","only","focus","*","*","offlinely","*","*","turn","a","specific","task","to","rollinng","-","To","make","the","implementation","easier",",","following","factors","are","ignored",".","-","The","tasks","is","dependent","(","e.g",".","time","series",")",".","Related","modules","and","difference","from","me",":","-","MetaController",":","It","is","learning","how","to","handle","a","task","(","e.g",".","learning","to","learn",")",".","-","But","rolling","is","about","how","to","split","a","single","task","into","tasks","in","time","series","and","run","them",".","-","OnlineStrategy",":","It","is","focusing","on","serving","a","model",",","the","model","can","be","updated","time","dependently","in","time",".","-","Rolling","is","much","simpler","and","is","only","for","testing","rolling","models","offline",".","It","does","not","want","to","share","the","interface","with","OnlineStrategy",".","The","code","about","rolling","is","shared","in","`","task_generator","`","&","`","RollingGen","`","level","between","me","and","the","above","modules","But","it","is","for","different","purpose",",","so","other","parts","are","not","shared",".","..","code-block",":",":","shell","#","here","is","an","typical","use","case","of","the","module",".","python","-m","qlib.contrib.rolling.base","--","conf_path","<","path","to","the","yaml",">","run","*","*","NOTE","*","*","before","running","the","example",",","please","clean","your","previous","results","with","following","command","-","`","rm","-r","mlruns","`","-","Because","it","is","very","hard","to","permanently","delete","a","experiment","(","it","will","be","moved","into",".trash","and","raise","error","when","creating","experiment","with","same","name",")","."]
code: def _update_start_end_time(self, task: dict):
      if self.train_start is not None:
          seg = task["dataset"]["kwargs"]["segments"]["train"]
          task["dataset"]["kwargs"]["segments"]["train"] = (
              pd.Timestamp(self.train_start),
              seg[1],
          )
  
      if self.test_end is not None:
          seg = task["dataset"]["kwargs"]["segments"]["test"]
          task["dataset"]["kwargs"]["segments"]["test"] = seg[
              0
          ], pd.Timestamp(self.test_end)
      return task
  
imports: from copy import deepcopy
  from pathlib import Path
  from typing import List, Optional, Union
  import fire
  import pandas
  import yaml
  from qlib import auto_init
  from qlib.log import get_module_logger
  from qlib.model.ens.ensemble import RollingEnsemble
  from qlib.model.trainer import TrainerR
  from qlib.utils import get_cls_kwargs, init_instance_by_config
  from qlib.utils.data import update_config
  from qlib.workflow import R
  from qlib.workflow.record_temp import SignalRecord
  from qlib.workflow.task.collect import RecorderCollector
  from qlib.workflow.task.gen import RollingGen, task_generator
  from qlib.workflow.task.utils import replace_task_handler_with_cache
label_desc: Use image node_id 4 for calling the Rolling obj's underlying member method code with example usage: obj._update_start_end_time(task) and returns: task