class_docstr: This class is primarily meant to be instantiated from ``train_test_split()`` function.
class_docstr_tok: ["This","class","is","primarily","meant","to","be","instantiated","from","``","train_test_split","(",")","``","function","."]
code: def __getitem__(self, i: int) -> TimeSeries:
      if self.axis == 0:
          split_index = self._get_horizontal_split_index()
          if self.type == "train":
              if i >= split_index:
                  raise IndexError(
                      "Exceeded the size of the training sequence."
                  )
              return self.data[i]
          else:
              if i + split_index >= len(self.data):
                  raise IndexError(
                      "Exceeded the size of the test sequence."
                  )
              return self.data[split_index + i]
      else:  # axis == 1
          (
              train_end_index,
              test_start_index,
          ) = self._get_vertical_split_indices(len(self.data[i]))
          if self.type == "train":
              return self.data[i][:train_end_index]
          else:
              return self.data[i][test_start_index:]
  
file_path: darts/darts/utils/model_selection.py
imports: from typing import Optional, Sequence, Tuple, Union
  from darts import TimeSeries
label_desc: Use image node_id 4 for calling the SplitTimeSeriesSequence obj's underlying member method code with example usage: obj.__getitem__(i) and returns: self, self, self, self