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 _last_slice(self, series: TimeSeries):
      split_point = len(series) - self.dataset.prediction_length
      prediction = series[
          split_point : split_point + self.prediction_length
      ]
      context = series[
          max(0, split_point - self.context_length) : split_point
      ]
      return context, prediction
  
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 4 for calling the SequentialTripletDataset obj's underlying member method code with example usage: obj._last_slice(series) and returns: context,  prediction