code: def collect_data(
      start_time: Union[pd.Timestamp, str],
      end_time: Union[pd.Timestamp, str],
      strategy: Union[str, dict, object, Path],
      executor: Union[str, dict, object, Path],
      benchmark: str = "SH000300",
      account: Union[float, int, dict] = 1e9,
      exchange_kwargs: dict = {},
      pos_type: str = "Position",
      return_value: dict | None = None,
  ) -> Generator[object, None, None]:
      """initialize the strategy and executor, then collect the trade decision data for rl training
  
      please refer to the docs of the backtest for the explanation of the parameters
  
      Yields
      -------
      object
          trade decision
      """
      trade_strategy, trade_executor = get_strategy_executor(
          start_time,
          end_time,
          strategy,
          executor,
          benchmark,
          account,
          exchange_kwargs,
          pos_type=pos_type,
      )
      yield from collect_data_loop(
          start_time,
          end_time,
          trade_strategy,
          trade_executor,
          return_value=return_value,
      )
  
file_path: qlib/qlib/backtest/__init__.py
imports: from __future__ import annotations
  import copy
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Generator, List, Optional, Tuple, Union
  import pandas
  from .account import Account
  from ..config import C
  from ..log import get_module_logger
  from ..utils import init_instance_by_config
  from .backtest import INDICATOR_METRIC, PORT_METRIC, backtest_loop, collect_data_loop
  from .decision import Order
  from .exchange import Exchange
  from .utils import CommonInfrastructure
label_desc: Use image node_id 5 for calling a global function with example usage: collect_data(start_time, end_time, strategy, executor, benchmark, account, exchange_kwargs, pos_type, return_value) without return types