class_docstr: The sampling triplet dataset randomly samples support sets and past queries
  along with their future prediction horizon.
  All three sets consist of time series windows sliced from the original time series. The support set time series
  end before the prediction horizon begins to avoid time leakage.
  The dataset yields infinitely many items. Support set time series length is for now context_length.
class_docstr_tok: ["The","sampling","triplet","dataset","randomly","samples","support","sets","and","past","queries","along","with","their","future","prediction","horizon",".","All","three","sets","consist","of","time","series","windows","sliced","from","the","original","time","series",".","The","support","set","time","series","end","before","the","prediction","horizon","begins","to","avoid","time","leakage",".","The","dataset","yields","infinitely","many","items",".","Support","set","time","series","length","is","for","now","context_length","."]
code: def _sample_queries(self):
      query_past = []
      query_future = []
      query_cheat = []
      for _ in range(self.num_queries):
          # First, sample a time series with probability relative to its length
          idx = next(self.index_iterator)
          series = self.dataset[idx]
  
          # Then, sample a slice with uniform probability
          # context should be at least prediction length long
          split_point = np.random.choice(
              np.arange(
                  self.prediction_length,
                  len(series) - self.prediction_length + 1,
              )
          )
          prediction = series[
              split_point : split_point + self.prediction_length
          ]
          context_start = max(0, split_point - self.context_length)
          context = series[context_start:split_point]
  
          query_past.append(context)
          query_future.append(prediction)
  
          # sample the start of the cheat time series
          cheat_earliest_start = max(
              0,
              context_start
              - self.support_length
              + self.context_length
              + self.prediction_length,
          )
          cheat_start = np.random.choice(
              np.arange(cheat_earliest_start, context_start + 1)
          )
          cheat_end = min(
              len(series), cheat_start + self.support_length
          )
          query_cheat.append(series[cheat_start:cheat_end])
      return query_past, query_future, query_cheat, idx
  
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 3 for calling the SamplingTripletDataset obj's underlying member method code with example usage: obj._sample_queries() and returns: query_past,  query_future,  query_cheat,  idx