code: def get_dataset(
      dataset_name: str,
      path: Path = default_dataset_path,
      regenerate: bool = False,
      dataset_writer: DatasetWriter = default_dataset_writer,
      prediction_length: Optional[int] = None,
  ) -> TrainDatasets:
      """
      Get a repository dataset.
  
      The datasets that can be obtained through this function have been used
      with different processing over time by several papers (e.g., [SFG17]_,
      [LCY+18]_, and [YRD15]_) or are obtained through the `Monash Time Series
      Forecasting Repository <https://forecastingdata.org/>`_.
  
      Parameters
      ----------
      dataset_name
          Name of the dataset, for instance "m4_hourly".
      regenerate
          Whether to regenerate the dataset even if a local file is present.
          If this flag is False and the file is present, the dataset will not
          be downloaded again.
      path
          Where the dataset should be saved.
      prediction_length
          The prediction length to be used for the dataset. If None, the default
          prediction length will be used. If the dataset is already materialized,
          setting this option to a different value does not have an effect.
          Make sure to set `regenerate=True` in this case. Note that some
          datasets from the Monash Time Series Forecasting Repository do not
          actually have a default prediction length -- the default then depends
          on the frequency of the data:
          - Minutely data --> prediction length of 60 (one hour)
          - Hourly data --> prediction length of 48 (two days)
          - Daily data --> prediction length of 30 (one month)
          - Weekly data --> prediction length of 8 (two months)
          - Monthly data --> prediction length of 12 (one year)
          - Yearly data --> prediction length of 4 (four years)
  
      Returns
      -------
          Dataset obtained by either downloading or reloading from local file.
      """
      dataset_path = materialize_dataset(
          dataset_name,
          path,
          regenerate,
          dataset_writer,
          prediction_length,
      )
  
      return load_datasets(
          metadata=dataset_path,
          train=dataset_path / "train",
          test=dataset_path / "test",
      )
  
imports: import logging
  import shutil
  from functools import partial
  from pathlib import Path
  from typing import Any, Dict, Optional
  from gluonts.dataset import DatasetWriter
  from gluonts.dataset.artificial import ConstantDataset
  from gluonts.dataset.common import TrainDatasets, load_datasets
  from gluonts.dataset.jsonl import JsonLinesWriter
  from ._artificial import generate_artificial_dataset
  from ._airpassengers import generate_airpassengers_dataset
  from ._gp_copula_2019 import generate_gp_copula_dataset
  from ._lstnet import generate_lstnet_dataset
  from ._m3 import generate_m3_dataset
  from ._m4 import generate_m4_dataset
  from ._m5 import generate_m5_dataset
  from ._tsf_datasets import generate_forecasting_dataset
  from ._uber_tlc import generate_uber_dataset
label_desc: Use image node_id 3 for calling a global function with example usage: get_dataset(dataset_name, path, regenerate, dataset_writer, prediction_length) and returns: load_datasets