code: def backtest(
      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",
  ) -> Tuple[PORT_METRIC, INDICATOR_METRIC]:
      """initialize the strategy and executor, then backtest function for the interaction of the outermost strategy and
      executor in the nested decision execution
  
      Parameters
      ----------
      start_time : Union[pd.Timestamp, str]
          closed start time for backtest
          **NOTE**: This will be applied to the outmost executor's calendar.
      end_time : Union[pd.Timestamp, str]
          closed end time for backtest
          **NOTE**: This will be applied to the outmost executor's calendar.
          E.g. Executor[day](Executor[1min]),   setting `end_time == 20XX0301` will include all the minutes on 20XX0301
      strategy : Union[str, dict, object, Path]
          for initializing outermost portfolio strategy. Please refer to the docs of init_instance_by_config for more
          information.
      executor : Union[str, dict, object, Path]
          for initializing the outermost executor.
      benchmark: str
          the benchmark for reporting.
      account : Union[float, int, Position]
          information for describing how to create the account
          For `float` or `int`:
              Using Account with only initial cash
          For `Position`:
              Using Account with a Position
      exchange_kwargs : dict
          the kwargs for initializing Exchange
      pos_type : str
          the type of Position.
  
      Returns
      -------
      portfolio_dict: PORT_METRIC
          it records the trading portfolio_metrics information
      indicator_dict: INDICATOR_METRIC
          it computes the trading indicator
          It is organized in a dict format
  
      """
      trade_strategy, trade_executor = get_strategy_executor(
          start_time,
          end_time,
          strategy,
          executor,
          benchmark,
          account,
          exchange_kwargs,
          pos_type=pos_type,
      )
      return backtest_loop(
          start_time, end_time, trade_strategy, trade_executor
      )
  
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 4 for calling a global function with example usage: backtest(start_time, end_time, strategy, executor, benchmark, account, exchange_kwargs, pos_type) and returns: backtest_loop