code: def _gen_stock_dataset(self, config, conf_type):
      try:
          path = config.pop("path")
      except KeyError as e:
          raise ValueError(
              "Must specify the path to save the dataset."
          ) from e
  
      if os.path.isfile(path + "tmp_dataset.pkl"):
          start = time.time()
          self.logger.info(
              f"[{__name__}]Dataset exists, load from disk."
          )
      else:
          start = time.time()
          if not os.path.exists(os.path.dirname(path)):
              os.makedirs(os.path.dirname(path))
          self.logger.info(f"[{__name__}]Generating dataset")
          self._prepare_calender_cache()
          dataset = init_instance_by_config(config)
          self.logger.info(
              f"[{__name__}]Dataset init, time cost: {time.time() - start:.2f}"
          )
          dataset.config(dump_all=False, recursive=True)
          dataset.to_pickle(path + "tmp_dataset.pkl")
  
      with open(path + "tmp_dataset.pkl", "rb") as f:
          new_dataset = pkl.load(f)
  
      instruments = D.instruments(market="all")
      stock_list = D.list_instruments(
          instruments=instruments,
          start_time=self.start_time,
          end_time=self.end_time,
          freq=self.freq,
          as_list=True,
      )
  
      def generate_dataset(stock):
          if os.path.isfile(path + stock + ".pkl"):
              print("exist " + stock)
              return
          self._init_qlib(self.qlib_conf)
          new_dataset.handler.config(**{"instruments": [stock]})
          if conf_type == "backtest":
              new_dataset.handler.setup_data()
          else:
              new_dataset.handler.setup_data(
                  init_type=DataHandlerLP.IT_LS
              )
          new_dataset.config(dump_all=True, recursive=True)
          new_dataset.to_pickle(path + stock + ".pkl")
  
      Parallel(n_jobs=32)(
          delayed(generate_dataset)(stock) for stock in stock_list
      )
  
imports: import os
  import time
  import datetime
  from typing import Optional
  import qlib
  from qlib import get_module_logger
  from qlib.data import D
  from qlib.config import REG_CN
  from qlib.utils import init_instance_by_config
  from qlib.data.dataset.handler import DataHandlerLP
  from qlib.data.data import Cal
  from qlib.contrib.ops.high_freq import get_calendar_day, DayLast, FFillNan, BFillNan, Date, Select, IsNull, IsInf, Cut
  import pickle
  from joblib import Parallel, delayed
label_desc: Use image node_id 10 for calling the HighFreqProvider obj's underlying member method code with example usage: obj._gen_stock_dataset(config, conf_type) without return types