docstr: preprocess the volume limit.
  get the fields need to get from qlib.
  get the volume limit list of buying and selling which is composed of all limits.
  Parameters
  ----------
  volume_threshold :
      please refer to the doc of exchange.
  Returns
  -------
  fields: set
      the fields need to get from qlib.
  buy_vol_limit: List[Tuple[str]]
      all volume limits of buying.
  sell_vol_limit: List[Tuple[str]]
      all volume limits of selling.
  Raises
  ------
  ValueError
      the format of volume_threshold is not supported.
docstr_tok: ["preprocess","the","volume","limit",".","get","the","fields","need","to","get","from","qlib",".","get","the","volume","limit","list","of","buying","and","selling","which","is","composed","of","all","limits",".","Parameters","--","--","--","--","--","volume_threshold",":","please","refer","to","the","doc","of","exchange",".","Returns","--","--","--","-","fields",":","set","the","fields","need","to","get","from","qlib",".","buy_vol_limit",":","List","[","Tuple","[","str","]","]","all","volume","limits","of","buying",".","sell_vol_limit",":","List","[","Tuple","[","str","]","]","all","volume","limits","of","selling",".","Raises","--","--","--","ValueError","the","format","of","volume_threshold","is","not","supported","."]
code: def _get_vol_limit(
      volume_threshold: Union[tuple, dict, None]
  ) -> Tuple[Optional[list], Optional[list], set]:
      """
      preprocess the volume limit.
      get the fields need to get from qlib.
      get the volume limit list of buying and selling which is composed of all limits.
      Parameters
      ----------
      volume_threshold :
          please refer to the doc of exchange.
      Returns
      -------
      fields: set
          the fields need to get from qlib.
      buy_vol_limit: List[Tuple[str]]
          all volume limits of buying.
      sell_vol_limit: List[Tuple[str]]
          all volume limits of selling.
      Raises
      ------
      ValueError
          the format of volume_threshold is not supported.
      """
      if volume_threshold is None:
          return None, None, set()
  
      fields = set()
      buy_vol_limit = []
      sell_vol_limit = []
      if isinstance(volume_threshold, tuple):
          volume_threshold = {"all": volume_threshold}
  
      assert isinstance(volume_threshold, dict)
      for key, vol_limit in volume_threshold.items():
          assert isinstance(vol_limit, tuple)
          fields.add(vol_limit[1])
  
          if key in ("buy", "all"):
              buy_vol_limit.append(vol_limit)
          if key in ("sell", "all"):
              sell_vol_limit.append(vol_limit)
  
      return buy_vol_limit, sell_vol_limit, fields
  
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 5 for calling the Exchange obj's underlying member method code with example usage: obj._get_vol_limit(volume_threshold) and returns: buy_vol_limit,  sell_vol_limit,  fields, None,  None,  set