class_docstr: Single window splitter.
  
  Split time series once into a training and test set.
  See more details on what to expect from this splitter in :class:`BaseSplitter`.
  
  Test window is defined by forecasting horizons
  relative to the end of the training window.
  It will contain as many indices
  as there are forecasting horizons provided to the `fh` argument.
  For a forecasating horizon :math:`(h_1,\ldots,h_H)`, the training window will
  consist of the indices :math:`(k_n+h_1,\ldots,k_n+h_H)`.
  
  Parameters
  ----------
  fh : int, list or np.array
      Forecasting horizon
  window_length : int or timedelta or pd.DateOffset
      Window length
  
  Examples
  --------
  >>> import numpy as np
  >>> from sktime.split import SingleWindowSplitter
  >>> ts = np.arange(10)
  >>> splitter = SingleWindowSplitter(fh=[2, 4], window_length=3)
  >>> list(splitter.split(ts)) # doctest: +SKIP
  [(array([3, 4, 5]), array([7, 9]))]
class_docstr_tok: ["Single","window","splitter",".","Split","time","series","once","into","a","training","and","test","set",".","See","more","details","on","what","to","expect","from","this","splitter","in",":","class",":","`","BaseSplitter","`",".","Test","window","is","defined","by","forecasting","horizons","relative","to","the","end","of","the","training","window",".","It","will","contain","as","many","indices","as","there","are","forecasting","horizons","provided","to","the","`","fh","`","argument",".","For","a","forecasating","horizon",":","math",":","`","(","h_1",",","\\ldots",",","h_H",")","`",",","the","training","window","will","consist","of","the","indices",":","math",":","`","(","k_n+h_1",",","\\ldots",",","k_n+h_H",")","`",".","Parameters","--","--","--","--","--","fh",":","int",",","list","or","np.array","Forecasting","horizon","window_length",":","int","or","timedelta","or","pd.DateOffset","Window","length","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","sktime.split","import","SingleWindowSplitter",">",">",">","ts","=","np.arange","(","10",")",">",">",">","splitter","=","SingleWindowSplitter","(","fh=","[","2",",","4","]",",","window_length=3",")",">",">",">","list","(","splitter.split","(","ts",")",")","#","doctest",":","+SKIP","[","(","array","(","[","3",",","4",",","5","]",")",",","array","(","[","7",",","9","]",")",")","]"]
code: def _split(self, y: pd.Index) -> SPLIT_GENERATOR_TYPE:
      n_timepoints = y.shape[0]
      window_length = check_window_length(
          self.window_length, n_timepoints
      )
      fh = _check_fh(self.fh)
      train_end = _get_end(y_index=y, fh=fh)
      training_window = _get_train_window_via_endpoint(
          y, train_end, window_length
      )
      if array_is_int(fh):
          test_window = train_end + fh.to_numpy()
      else:
          test_window = y.get_indexer(y[train_end] + fh.to_pandas())
  
      yield training_window, test_window
  
file_path: sktime/sktime/split/singlewindow.py
imports: from typing import Optional
  import numpy
  import pandas
  from sktime.datatypes._utilities import get_index_for_series
  from sktime.split.base import BaseSplitter
  from sktime.split.base._common import ACCEPTED_Y_TYPES, FORECASTING_HORIZON_TYPES, SPLIT_GENERATOR_TYPE, _check_fh, _check_inputs_for_compatibility, _get_end, _get_train_window_via_endpoint
  from sktime.utils.validation import ACCEPTED_WINDOW_LENGTH_TYPES, array_is_int, check_window_length
label_desc: Use image node_id 2 for calling the SingleWindowSplitter obj's underlying member method code with example usage: obj._split(y) without return types