docstr: if stock is suspended(hence not tradable), True will be returned
docstr_tok: ["if","stock","is","suspended","(","hence","not","tradable",")",",","True","will","be","returned"]
code: def check_stock_suspended(
      self,
      stock_id: str,
      start_time: pd.Timestamp,
      end_time: pd.Timestamp,
  ) -> bool:
      """if stock is suspended(hence not tradable), True will be returned"""
      # is suspended
      if stock_id in self.quote.get_all_stock():
          # suspended stocks are represented by None $close stock
          # The $close may contain NaN,
          close = self.quote.get_data(
              stock_id, start_time, end_time, "$close"
          )
          if close is None:
              # if no close record exists
              return True
          elif isinstance(close, IndexData):
              # **any** non-NaN $close represents trading opportunity may exist
              #  if all returned is nan, then the stock is suspended
              return cast(bool, cast(IndexData, close).isna().all())
          else:
              # it is single value, make sure is not None
              return np.isnan(close)
      else:
          # if the stock is not in the stock list, then it is not tradable and regarded as suspended
          return True
  
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 7 for calling the Exchange obj's underlying member method code with example usage: obj.check_stock_suspended(stock_id, start_time, end_time) and returns: True, True, cast, np