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: Get tasks from every strategy's first_tasks method and train them.
  If using DelayTrainer, it can finish training all together after every strategy's first_tasks.
  
  Args:
      strategies (List[OnlineStrategy]): the strategies list (need this param when adding strategies). None for use default strategies.
      model_kwargs (dict): the params for `prepare_online_models`
docstr_tok: ["Get","tasks","from","every","strategy","'s","first_tasks","method","and","train","them",".","If","using","DelayTrainer",",","it","can","finish","training","all","together","after","every","strategy","'s","first_tasks",".","Args",":","strategies","(","List","[","OnlineStrategy","]",")",":","the","strategies","list","(","need","this","param","when","adding","strategies",")",".","None","for","use","default","strategies",".","model_kwargs","(","dict",")",":","the","params","for","`","prepare_online_models","`"]
code: def first_train(
      self,
      strategies: List[OnlineStrategy] = None,
      model_kwargs: dict = {},
  ):
      """
      Get tasks from every strategy's first_tasks method and train them.
      If using DelayTrainer, it can finish training all together after every strategy's first_tasks.
  
      Args:
          strategies (List[OnlineStrategy]): the strategies list (need this param when adding strategies). None for use default strategies.
          model_kwargs (dict): the params for `prepare_online_models`
      """
      if strategies is None:
          strategies = self.strategies
  
      models_list = []
      for strategy in strategies:
          self.logger.info(
              f"Strategy `{strategy.name_id}` begins first training..."
          )
          tasks = strategy.first_tasks()
          models = self.trainer.train(
              tasks, experiment_name=strategy.name_id
          )
          models_list.append(models)
          self.logger.info(f"Finished training {len(models)} models.")
          # FIXME: Train multiple online models at `first_train` will result in getting too much online models at the
          # start.
          online_models = strategy.prepare_online_models(
              models, **model_kwargs
          )
          self.history.setdefault(self.cur_time, {})[
              strategy
          ] = online_models
  
      if not self._postpone_action():
          for strategy, models in zip(strategies, models_list):
              models = self.trainer.end_train(
                  models, experiment_name=strategy.name_id
              )
  
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 3 for calling the OnlineManager obj's underlying member method code with example usage: obj.first_train(strategies, model_kwargs) without return types