code: def get_hs_stock_symbols() -> list:
      """get SH/SZ stock symbols
  
      Returns
      -------
          stock symbols
      """
      global _HS_SYMBOLS  # pylint: disable=W0603
  
      def _get_symbol():
          _res = set()
          for _k, _v in (("ha", "ss"), ("sa", "sz"), ("gem", "sz")):
              resp = requests.get(
                  HS_SYMBOLS_URL.format(s_type=_k), timeout=None
              )
              _res |= set(
                  map(
                      lambda x: "{}.{}".format(
                          re.findall(r"\d+", x)[0], _v
                      ),  # pylint: disable=W0640
                      etree.HTML(resp.text).xpath(
                          "//div[@class='result']/ul//li/a/text()"
                      ),  # pylint: disable=I1101
                  )
              )
              time.sleep(3)
          return _res
  
      if _HS_SYMBOLS is None:
          symbols = set()
          _retry = 60
          # It may take multiple times to get the complete
          while len(symbols) < MINIMUM_SYMBOLS_NUM:
              symbols |= _get_symbol()
              time.sleep(3)
  
          symbol_cache_path = (
              Path("~/.cache/hs_symbols_cache.pkl")
              .expanduser()
              .resolve()
          )
          symbol_cache_path.parent.mkdir(parents=True, exist_ok=True)
          if symbol_cache_path.exists():
              with symbol_cache_path.open("rb") as fp:
                  cache_symbols = pickle.load(fp)
                  symbols |= cache_symbols
          with symbol_cache_path.open("wb") as fp:
              pickle.dump(symbols, fp)
  
          _HS_SYMBOLS = sorted(list(symbols))
  
      return _HS_SYMBOLS
  
imports: import re
  import copy
  import importlib
  import time
  import bisect
  import pickle
  import random
  import requests
  import functools
  from pathlib import Path
  from typing import Iterable, Tuple, List
  import numpy
  import pandas
  from lxml import etree
  from loguru import logger
  from yahooquery import Ticker
  from tqdm import tqdm
  from functools import partial
  from concurrent.futures import ProcessPoolExecutor
  from bs4 import BeautifulSoup
label_desc: Use image node_id 4 for calling a global function with example usage: get_hs_stock_symbols() and returns: _HS_SYMBOLS, _res