code: def get_calendar_list(bench_code="CSI300") -> List[pd.Timestamp]:
      """get SH/SZ history calendar list
  
      Parameters
      ----------
      bench_code: str
          value from ["CSI300", "CSI500", "ALL", "US_ALL"]
  
      Returns
      -------
          history calendar list
      """
  
      logger.info(f"get calendar list: {bench_code}......")
  
      def _get_calendar(url):
          _value_list = requests.get(url, timeout=None).json()["data"][
              "klines"
          ]
          return sorted(
              map(lambda x: pd.Timestamp(x.split(",")[0]), _value_list)
          )
  
      calendar = _CALENDAR_MAP.get(bench_code, None)
      if calendar is None:
          if (
              bench_code.startswith("US_")
              or bench_code.startswith("IN_")
              or bench_code.startswith("BR_")
          ):
              print(Ticker(CALENDAR_BENCH_URL_MAP[bench_code]))
              print(
                  Ticker(CALENDAR_BENCH_URL_MAP[bench_code]).history(
                      interval="1d", period="max"
                  )
              )
              df = Ticker(CALENDAR_BENCH_URL_MAP[bench_code]).history(
                  interval="1d", period="max"
              )
              calendar = (
                  df.index.get_level_values(level="date")
                  .map(pd.Timestamp)
                  .unique()
                  .tolist()
              )
          else:
              if bench_code.upper() == "ALL":
  
                  @deco_retry
                  def _get_calendar(month):
                      _cal = []
                      try:
                          resp = requests.get(
                              SZSE_CALENDAR_URL.format(
                                  month=month, random=random.random
                              ),
                              timeout=None,
                          ).json()
                          for _r in resp["data"]:
                              if int(_r["jybz"]):
                                  _cal.append(pd.Timestamp(_r["jyrq"]))
                      except Exception as e:
                          raise ValueError(f"{month}-->{e}") from e
                      return _cal
  
                  month_range = pd.date_range(
                      start="2000-01",
                      end=pd.Timestamp.now() + pd.Timedelta(days=31),
                      freq="M",
                  )
                  calendar = []
                  for _m in month_range:
                      cal = _get_calendar(_m.strftime("%Y-%m"))
                      if cal:
                          calendar += cal
                  calendar = list(
                      filter(
                          lambda x: x <= pd.Timestamp.now(), calendar
                      )
                  )
              else:
                  calendar = _get_calendar(
                      CALENDAR_BENCH_URL_MAP[bench_code]
                  )
          _CALENDAR_MAP[bench_code] = calendar
      logger.info(f"end of get calendar list: {bench_code}.")
      return calendar
  
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 1 for calling a global function with example usage: get_calendar_list(bench_code) and returns: calendar, sorted, _cal