class_docstr: The super sampling triplet dataset randomly samples support sets and past queries
  along with their future prediction horizon from a list of sampling datasets.
  First a sampling dataset is randomly chosen.
  Then the chosen triplet dataset samples support, query past and query future set.
  The dataset yields infinitely many items.
class_docstr_tok: ["The","super","sampling","triplet","dataset","randomly","samples","support","sets","and","past","queries","along","with","their","future","prediction","horizon","from","a","list","of","sampling","datasets",".","First","a","sampling","dataset","is","randomly","chosen",".","Then","the","chosen","triplet","dataset","samples","support",",","query","past","and","query","future","set",".","The","dataset","yields","infinitely","many","items","."]
docstr: Args:
      datasets: The base datasets to sample from.
docstr_tok: ["Args",":","datasets",":","The","base","datasets","to","sample","from","."]
code: def __init__(
      self,
      datasets: List[SamplingTripletDataset],
      dataset_sampling: str,
  ):
      """
      Args:
          datasets: The base datasets to sample from.
      """
  
      # Initialize
      super().__init__()
      datasets = list(datasets)
      self.datasets = [iter(dataset) for dataset in datasets]
  
      if dataset_sampling == "weighted":
          # Sample a dataset with probability relative to the total number of observations in it
          self.dataset_weights = [
              sampling_dataset.dataset.number_of_time_steps
              for sampling_dataset in datasets
          ]
          self.dataset_weights = np.array(self.dataset_weights) / sum(
              self.dataset_weights
          )
      elif dataset_sampling == "uniform":
          self.dataset_weights = None
      else:
          raise ValueError(
              f"dataset sampling {dataset_sampling} is not implemented."
          )
  
imports: from __future__ import annotations
  import numpy
  import pandas
  from dataclasses import dataclass, fields
  from typing import Iterator, List, Optional
  import torch
  from torch.utils.data import IterableDataset, Dataset
  from .dataset import TimeSeries, TimeSeriesDataset
label_desc: Use image node_id 1 to create a new SuperSamplingTripletDataset object from inherited base classes: IterableDataset with example: obj = SuperSamplingTripletDataset(datasets, dataset_sampling)