docstr: Generate tasks for rolling
  
  Parameters
  ----------
  step : int
      step to rolling
  rtype : str
      rolling type (expanding, sliding)
  ds_extra_mod_func: Callable
      A method like: handler_mod(task: dict, rg: RollingGen)
      Do some extra action after generating a task. For example, use ``handler_mod`` to modify the end time of the handler of a dataset.
  trunc_days: int
      trunc some data to avoid future information leakage
  task_copy_func: Callable
      the function to copy entire task. This is very useful when user want to share something between tasks
docstr_tok: ["Generate","tasks","for","rolling","Parameters","--","--","--","--","--","step",":","int","step","to","rolling","rtype",":","str","rolling","type","(","expanding",",","sliding",")","ds_extra_mod_func",":","Callable","A","method","like",":","handler_mod","(","task",":","dict",",","rg",":","RollingGen",")","Do","some","extra","action","after","generating","a","task",".","For","example",",","use","``","handler_mod","``","to","modify","the","end","time","of","the","handler","of","a","dataset",".","trunc_days",":","int","trunc","some","data","to","avoid","future","information","leakage","task_copy_func",":","Callable","the","function","to","copy","entire","task",".","This","is","very","useful","when","user","want","to","share","something","between","tasks"]
code: def __init__(
      self,
      step: int = 40,
      rtype: str = ROLL_EX,
      ds_extra_mod_func: Union[None, Callable] = handler_mod,
      test_key="test",
      train_key="train",
      trunc_days: int = None,
      task_copy_func: Callable = copy.deepcopy,
  ):
      """
      Generate tasks for rolling
  
      Parameters
      ----------
      step : int
          step to rolling
      rtype : str
          rolling type (expanding, sliding)
      ds_extra_mod_func: Callable
          A method like: handler_mod(task: dict, rg: RollingGen)
          Do some extra action after generating a task. For example, use ``handler_mod`` to modify the end time of the handler of a dataset.
      trunc_days: int
          trunc some data to avoid future information leakage
      task_copy_func: Callable
          the function to copy entire task. This is very useful when user want to share something between tasks
      """
      self.step = step
      self.rtype = rtype
      self.ds_extra_mod_func = ds_extra_mod_func
      self.ta = TimeAdjuster(future=True)
  
      self.test_key = test_key
      self.train_key = train_key
      self.trunc_days = trunc_days
      self.task_copy_func = task_copy_func
  
imports: import abc
  import copy
  import pandas
  from typing import Dict, List, Union, Callable
  from qlib.utils import transform_end_date
  from .utils import TimeAdjuster
label_desc: Use image node_id 1 to create a new RollingGen object from inherited base classes: TaskGen with example: obj = RollingGen(step, rtype, ds_extra_mod_func, test_key, train_key, trunc_days, task_copy_func)