class_docstr: A triplet batch, composed of a batch of support sets, query contexts and prediction horizons.
  Compared to a simple triplet, it also manages the lengths of all samples.
class_docstr_tok: ["A","triplet","batch",",","composed","of","a","batch","of","support","sets",",","query","contexts","and","prediction","horizons",".","Compared","to","a","simple","triplet",",","it","also","manages","the","lengths","of","all","samples","."]
docstr: Choose the first n splits of each series batch and return the resulting triplet batch.
docstr_tok: ["Choose","the","first","n","splits","of","each","series","batch","and","return","the","resulting","triplet","batch","."]
code: def first_n(self, n: int) -> TripletBatch:
      """
      Choose the first n splits of each series batch and return the resulting triplet batch.
      """
      return TripletBatch(
          support_set=self.support_set.first_n(n),
          query_past=self.query_past.first_n(n),
          query_future=self.query_future.first_n(n),
      )
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from typing import List, Optional
  import torch
  from torch.nn.utils.rnn import pad_sequence
  from .sampling import Triplet
  from .dataset import TimeSeries
  from meta.common.torch import tensor_to_np
label_desc: Use image node_id 5 for calling the TripletBatch obj's underlying member method code with example usage: obj.first_n(n) and returns: TripletBatch