class_docstr: OnlineManager can manage online models with `Online Strategy <#Online Strategy>`_.
  It also provides a history recording of which models are online at what time.
docstr: After preparing the data of the last routine (a box in box-plot) which means the end of the routine, we can prepare trading signals for the next routine.
  
  NOTE: Given a set prediction, all signals before these prediction end times will be prepared well.
  
  Even if the latest signal already exists, the latest calculation result will be overwritten.
  
  .. note::
  
      Given a prediction of a certain time, all signals before this time will be prepared well.
  
  Args:
      prepare_func (Callable, optional): Get signals from a dict after collecting. Defaults to AverageEnsemble(), the results collected by MergeCollector must be {xxx:pred}.
      over_write (bool, optional): If True, the new signals will overwrite. If False, the new signals will append to the end of signals. Defaults to False.
  
  Returns:
      pd.DataFrame: the signals.
docstr_tok: ["After","preparing","the","data","of","the","last","routine","(","a","box","in","box-plot",")","which","means","the","end","of","the","routine",",","we","can","prepare","trading","signals","for","the","next","routine",".","NOTE",":","Given","a","set","prediction",",","all","signals","before","these","prediction","end","times","will","be","prepared","well",".","Even","if","the","latest","signal","already","exists",",","the","latest","calculation","result","will","be","overwritten",".","..","note",":",":","Given","a","prediction","of","a","certain","time",",","all","signals","before","this","time","will","be","prepared","well",".","Args",":","prepare_func","(","Callable",",","optional",")",":","Get","signals","from","a","dict","after","collecting",".","Defaults","to","AverageEnsemble","(",")",",","the","results","collected","by","MergeCollector","must","be","{","xxx",":","pred","}",".","over_write","(","bool",",","optional",")",":","If","True",",","the","new","signals","will","overwrite",".","If","False",",","the","new","signals","will","append","to","the","end","of","signals",".","Defaults","to","False",".","Returns",":","pd.DataFrame",":","the","signals","."]
code: def prepare_signals(
      self, prepare_func: Callable = AverageEnsemble(), over_write=False
  ):
      """
      After preparing the data of the last routine (a box in box-plot) which means the end of the routine, we can prepare trading signals for the next routine.
  
      NOTE: Given a set prediction, all signals before these prediction end times will be prepared well.
  
      Even if the latest signal already exists, the latest calculation result will be overwritten.
  
      .. note::
  
          Given a prediction of a certain time, all signals before this time will be prepared well.
  
      Args:
          prepare_func (Callable, optional): Get signals from a dict after collecting. Defaults to AverageEnsemble(), the results collected by MergeCollector must be {xxx:pred}.
          over_write (bool, optional): If True, the new signals will overwrite. If False, the new signals will append to the end of signals. Defaults to False.
  
      Returns:
          pd.DataFrame: the signals.
      """
      signals = prepare_func(self.get_collector()())
      old_signals = self.signals
      if old_signals is not None and not over_write:
          old_max = old_signals.index.get_level_values("datetime").max()
          new_signals = signals.loc[old_max:]
          signals = pd.concat([old_signals, new_signals], axis=0)
      else:
          new_signals = signals
      self.logger.info(
          f"Finished preparing new {len(new_signals)} signals."
      )
      self.signals = signals
      return new_signals
  
imports: import logging
  from typing import Callable, List, Union
  import pandas
  from qlib import get_module_logger
  from qlib.data.data import D
  from qlib.log import set_global_logger_level
  from qlib.model.ens.ensemble import AverageEnsemble
  from qlib.model.trainer import Trainer, TrainerR
  from qlib.utils.serial import Serializable
  from qlib.workflow.online.strategy import OnlineStrategy
  from qlib.workflow.task.collect import MergeCollector
label_desc: Use image node_id 7 for calling the OnlineManager obj's underlying member method code with example usage: obj.prepare_signals(prepare_func, over_write) and returns: new_signals