code: def _gen_dataset(self, config):
      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):
          start = time.time()
          self.logger.info(
              f"[{__name__}]Dataset exists, load from disk."
          )
  
          with open(path, "rb") as f:
              dataset = pkl.load(f)
          self.logger.info(
              f"[{__name__}]Data loaded, time cost: {time.time() - start:.2f}"
          )
      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.prepare(["train", "valid", "test"])
          self.logger.info(
              f"[{__name__}]Dataset prepared, time cost: {time.time() - start:.2f}"
          )
          dataset.config(dump_all=True, recursive=True)
          dataset.to_pickle(path)
      return dataset
  
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 8 for calling the HighFreqProvider obj's underlying member method code with example usage: obj._gen_dataset(config) and returns: dataset