class_docstr: This example strategy always uses the latest rolling model sas online models.
class_docstr_tok: ["This","example","strategy","always","uses","the","latest","rolling","model","sas","online","models","."]
docstr: Prepare new tasks based on cur_time (None for the latest).
  
  You can find the last online models by OnlineToolR.online_models.
  
  Returns:
      List[dict]: a list of new tasks.
docstr_tok: ["Prepare","new","tasks","based","on","cur_time","(","None","for","the","latest",")",".","You","can","find","the","last","online","models","by","OnlineToolR.online_models",".","Returns",":","List","[","dict","]",":","a","list","of","new","tasks","."]
code: def prepare_tasks(self, cur_time) -> List[dict]:
      """
      Prepare new tasks based on cur_time (None for the latest).
  
      You can find the last online models by OnlineToolR.online_models.
  
      Returns:
          List[dict]: a list of new tasks.
      """
      # TODO: filter recorders by latest test segments is not a necessary
      latest_records, max_test = self._list_latest(
          self.tool.online_models()
      )
      if max_test is None:
          self.logger.warn(f"No latest online recorders, no new tasks.")
          return []
      calendar_latest = transform_end_date(cur_time)
      self.logger.info(
          f"The interval between current time {calendar_latest} and last rolling test begin time {max_test[0]} is {self.ta.cal_interval(calendar_latest, max_test[0])}, the rolling step is {self.rg.step}"
      )
      res = []
      for rec in latest_records:
          task = rec.load_object("task")
          res.extend(self.rg.gen_following_tasks(task, calendar_latest))
      return res
  
imports: from typing import List, Union
  from qlib.log import get_module_logger
  from qlib.model.ens.group import RollingGroup
  from qlib.utils import transform_end_date
  from qlib.workflow.online.utils import OnlineTool, OnlineToolR
  from qlib.workflow.recorder import Recorder
  from qlib.workflow.task.collect import Collector, RecorderCollector
  from qlib.workflow.task.gen import RollingGen, task_generator
  from qlib.workflow.task.utils import TimeAdjuster
label_desc: Use image node_id 4 for calling the RollingStrategy obj's underlying member method code with example usage: obj.prepare_tasks(cur_time) and returns: res, list