code: def generate_dominick_dataset(
      dataset_path: Path,
      prediction_length: Optional[int] = None,
  ):
      dataset = datasets["dominick"]
      dataset_path.mkdir(exist_ok=True)
  
      with TemporaryDirectory() as temp_dir:
          temp_path = Path(temp_dir)
  
          with ZipFile(dataset.download(temp_path)) as archive:
              archive.extractall(path=temp_path)
  
          # only one file is exptected
          reader = TSFReader(temp_path / archive.namelist()[0])
          meta, data = reader.read()
  
      freq = frequency_converter(meta.frequency)
      if prediction_length is None:
          if hasattr(meta, "forecast_horizon"):
              prediction_length = int(meta.forecast_horizon)
          else:
              prediction_length = (
                  default_prediction_length_from_frequency(freq)
              )
  
      save_metadata(dataset_path, len(data), freq, prediction_length)
  
      # Impute missing start dates with unix epoch and remove time series whose
      # length is less than or equal to the prediction length
      data = [
          {
              **d,
              "start_timestamp": d.get("start_timestamp", "1970-01-01"),
          }
          for d in data
          if len(d[FieldName.TARGET]) > prediction_length
      ]
      save_datasets(dataset_path, data, prediction_length)
  
file_path: gluonts/src/gluonts/nursery/few_shot_prediction/src/meta/datasets/dominick.py
imports: from pathlib import Path
  from tempfile import TemporaryDirectory
  from typing import Optional
  from zipfile import ZipFile
  from pandas.tseries.frequencies import to_offset
  from gluonts.dataset.field_names import FieldName
  from gluonts.dataset.repository._tsf_reader import TSFReader, frequency_converter
  from gluonts.dataset.repository._tsf_datasets import datasets, save_datasets, save_metadata
  from meta.datasets.gluonts import GluonTSDataModule
  from meta.datasets.registry import register_data_module
label_desc: Use image node_id 1 for calling a global function with example usage: generate_dominick_dataset(dataset_path, prediction_length) without return types