class_docstr: A data module which provides an arbitrary dataset from GlounTS.
  
  Parameters
  ----------
  dataset_name: str
      The GluonTS name of the dataset.
  context_length_multiple: int
      Context length is prediction length x ``context_length_multiple``.
  support_length_multiple: int
      Support time series length is prediction length x ``support_length_multiple``.
  support_set_size: int
      Number of time series in the support set.
  num_queries: int
      Number of queries used for the same support set.
  data_dir: pathlib.Path
      Path to data.
  prediction_length: int
      Number of predicted time steps.
  standardize: bool
      If each time series is standardized.
  batch_size_train: int
      Batch size during training.
  batch_size_val_test: int
      Batch size during validation and testing.
  num_workers: int
      Number of workers.
  seed: int
      The random seed.
  catch22_train: bool
      If catch22 similarity measure is used for support set selection during training.
  catch22_val_test: bool
      If catch22 similarity measure is used for support set selection during validation and testing.
  cheat: float
      Chance of hiding the ground truth in the support set.
class_docstr_tok: ["A","data","module","which","provides","an","arbitrary","dataset","from","GlounTS",".","Parameters","--","--","--","--","--","dataset_name",":","str","The","GluonTS","name","of","the","dataset",".","context_length_multiple",":","int","Context","length","is","prediction","length","x","``","context_length_multiple","``",".","support_length_multiple",":","int","Support","time","series","length","is","prediction","length","x","``","support_length_multiple","``",".","support_set_size",":","int","Number","of","time","series","in","the","support","set",".","num_queries",":","int","Number","of","queries","used","for","the","same","support","set",".","data_dir",":","pathlib.Path","Path","to","data",".","prediction_length",":","int","Number","of","predicted","time","steps",".","standardize",":","bool","If","each","time","series","is","standardized",".","batch_size_train",":","int","Batch","size","during","training",".","batch_size_val_test",":","int","Batch","size","during","validation","and","testing",".","num_workers",":","int","Number","of","workers",".","seed",":","int","The","random","seed",".","catch22_train",":","bool","If","catch22","similarity","measure","is","used","for","support","set","selection","during","training",".","catch22_val_test",":","bool","If","catch22","similarity","measure","is","used","for","support","set","selection","during","validation","and","testing",".","cheat",":","float","Chance","of","hiding","the","ground","truth","in","the","support","set","."]
code: def __init__(
      self,
      dataset_name: str,
      context_length_multiple: int,
      support_length_multiple: int,
      support_set_size: int,
      num_queries: int = 1,
      data_dir: Path = Path.home() / ".mxnet" / "gluon-ts",
      prediction_length: Optional[int] = None,
      standardize: bool = True,
      batch_size_train: int = 128,
      batch_size_val_test: int = 1000,
      num_workers: int = 0,
      seed: Optional[int] = None,
      catch22_train: bool = False,
      catch22_val_test: bool = False,
      cheat: float = 0.0,
  ):
      super().__init__()
      self.dataset_name = dataset_name
      self.data_dir = data_dir
      self.context_length_multiple = context_length_multiple
      self.support_length_multiple = support_length_multiple
      self._prediction_length = prediction_length
      self.support_set_size = support_set_size
      self.num_queries = num_queries
      self.standardize = standardize
      self.splits: DatasetSplits
      self.batch_size_train = batch_size_train
      self.batch_size_val_test = batch_size_val_test
      self.num_workers = num_workers
      self.seed = seed
      self.catch22_train = catch22_train
      self.catch22_val_test = catch22_val_test
      self.cheat = cheat
      assert (
          not cheat or num_queries == 1
      ), "Cheat sampling only allows num_queries = 1"
      assert not (
          (catch22_val_test or catch22_train) and num_queries > 1
      ), "Catch22 support set selection only works with num_queries equal to one."
  
imports: from typing import List, Optional, Literal, Dict, Any
  from pathlib import Path
  from functools import cached_property
  import shutil
  import tempfile
  import pickle
  import pandas
  from tqdm import tqdm
  import catch22
  import pytorch_lightning
  from gluonts.dataset.repository.datasets import materialize_dataset
  from gluonts.dataset.common import MetaData
  from torch.utils.data import DataLoader
  from sklearn.neighbors import NearestNeighbors
  from meta.data.batch import TripletBatch
  from meta.data.sampling import SamplingTripletDataset, SequentialTripletDataset
  from meta.datasets.splits import DatasetSplits
  from meta.data.dataset import TimeSeries
  from meta.datasets.preprocessing import Filter, AbsoluteValueFilter, ConstantTargetFilter, EndOfSeriesCutFilter, MinLengthFilter, read_transform_write, ItemIDTransform
  from meta.datasets.registry import register_data_module
label_desc: Use image node_id 1 to create a new GluonTSDataModule object from inherited base classes: pl with example: obj = GluonTSDataModule(dataset_name, context_length_multiple, support_length_multiple, support_set_size, num_queries, data_dir, prediction_length, standardize, batch_size_train, batch_size_val_test, num_workers, seed, catch22_train, catch22_val_test, cheat)