class_docstr: The sequential triplet dataset traverses the dataset and uses the last prediction length slice as future query.
  The support set is sampled randomly. The length of dataset is the number of times series
  divided by the number of queries.
class_docstr_tok: ["The","sequential","triplet","dataset","traverses","the","dataset","and","uses","the","last","prediction","length","slice","as","future","query",".","The","support","set","is","sampled","randomly",".","The","length","of","dataset","is","the","number","of","times","series","divided","by","the","number","of","queries","."]
code: def __getitem__(self, index: int) -> Triplet:
      start = index * self.num_queries
      end = start + self.num_queries
      query_past, query_future = zip(
          *(
              self._last_slice(self.dataset[i])
              for i in range(start, end)
          )
      )
      # support time series should end before earliest start of future queries
      q_split = min(q.start_date for q in query_future)
      query = self.dataset[index]
      cheat_query = query[
          max(0, len(query) - self.support_length) : len(query)
      ]
      support_set = sample_supps(
          supps_size=self.support_set_size,
          length=self.support_length,
          dataset=self.support_dataset,
          q_split=q_split,
          # TODO: The seeding does not work anymore, we could use torch again in the validation split
          # but this will be slower
          # seed=self.seed + index if self.seed else None,
          cheat_query=cheat_query
          if np.random.rand() < self.cheat
          else None,
          index_iterator=self.index_iterator
          if self.catch22_nn is None
          else iter(self.catch22_nn[query_past[0].item_id]),
      )
      return Triplet(support_set, query_past, query_future)
  
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 SequentialTripletDataset obj's underlying member method code with example usage: obj.__getitem__(index) and returns: Triplet