code: def get_deal_price(
      self,
      stock_id: str,
      start_time: pd.Timestamp,
      end_time: pd.Timestamp,
      direction: OrderDir,
      method: Optional[str] = "ts_data_last",
  ) -> Union[None, int, float, bool, IndexData]:
      if direction == OrderDir.SELL:
          pstr = self.sell_price
      elif direction == OrderDir.BUY:
          pstr = self.buy_price
      else:
          raise NotImplementedError(
              f"This type of input is not supported"
          )
  
      deal_price = self.quote.get_data(
          stock_id, start_time, end_time, field=pstr, method=method
      )
      if method is not None and (
          deal_price is None
          or np.isnan(deal_price)
          or deal_price <= 1e-08
      ):
          self.logger.warning(
              f"(stock_id:{stock_id}, trade_time:{(start_time, end_time)}, {pstr}): {deal_price}!!!"
          )
          self.logger.warning(f"setting deal_price to close price")
          deal_price = self.get_close(
              stock_id, start_time, end_time, method
          )
      return deal_price
  
imports: from __future__ import annotations
  from collections import defaultdict
  from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Type, Union, cast
  from ..utils.index_data import IndexData
  import random
  import numpy
  import pandas
  from qlib.backtest.position import BasePosition
  from ..config import C
  from ..constant import REG_CN, REG_TW
  from ..data.data import D
  from ..log import get_module_logger
  from .decision import Order, OrderDir, OrderHelper
  from .high_performance_ds import BaseQuote, NumpyQuote
label_desc: Use image node_id 14 for calling the Exchange obj's underlying member method code with example usage: obj.get_deal_price(stock_id, start_time, end_time, direction, method) and returns: deal_price