class_docstr: Base class for sliding and expanding window splitter.
docstr: Split `y` into training and test windows.
  
  This function encapsulates common functionality
  shared by concrete implementations of this abstract class.
  
  Parameters
  ----------
  window_length : int or timedelta or pd.DateOffset
      Length of training window
  y : pd.Index
      Index of time series to split
  fh : ForecastingHorizon
      Single step ahead or array of steps ahead to forecast.
  expanding : bool
      Expanding (True) or sliding window (False) splitter
  
  Yields
  ------
  train : 1D np.ndarray of int
      Training window iloc indices, in reference to y
  test : 1D np.ndarray of int
      Test window iloc indices, in reference to y
docstr_tok: ["Split","`","y","`","into","training","and","test","windows",".","This","function","encapsulates","common","functionality","shared","by","concrete","implementations","of","this","abstract","class",".","Parameters","--","--","--","--","--","window_length",":","int","or","timedelta","or","pd.DateOffset","Length","of","training","window","y",":","pd.Index","Index","of","time","series","to","split","fh",":","ForecastingHorizon","Single","step","ahead","or","array","of","steps","ahead","to","forecast",".","expanding",":","bool","Expanding","(","True",")","or","sliding","window","(","False",")","splitter","Yields","--","--","--","train",":","1D","np.ndarray","of","int","Training","window","iloc","indices",",","in","reference","to","y","test",":","1D","np.ndarray","of","int","Test","window","iloc","indices",",","in","reference","to","y"]
code: def _split_windows_generic(
      self,
      window_length: ACCEPTED_WINDOW_LENGTH_TYPES,
      y: pd.Index,
      fh: ForecastingHorizon,
      expanding: bool,
  ) -> SPLIT_GENERATOR_TYPE:
      """Split `y` into training and test windows.
  
      This function encapsulates common functionality
      shared by concrete implementations of this abstract class.
  
      Parameters
      ----------
      window_length : int or timedelta or pd.DateOffset
          Length of training window
      y : pd.Index
          Index of time series to split
      fh : ForecastingHorizon
          Single step ahead or array of steps ahead to forecast.
      expanding : bool
          Expanding (True) or sliding window (False) splitter
  
      Yields
      ------
      train : 1D np.ndarray of int
          Training window iloc indices, in reference to y
      test : 1D np.ndarray of int
          Test window iloc indices, in reference to y
      """
      start = self._get_start(y=y, fh=fh)
      split_points = (
          self.get_cutoffs(pd.Series(index=y, dtype=float)) + 1
      )
      split_points = (
          split_points
          if self._initial_window is None
          else split_points[1:]
      )
      for split_point in split_points:
          train_start = self._get_train_start(
              start=start if expanding else split_point,
              window_length=window_length,
              y=y,
          )
          train = self._get_train_window(
              y=y, train_start=train_start, split_point=split_point
          )
          if array_is_int(fh):
              test = split_point + fh.to_numpy() - 1
          else:
              test = np.argwhere(
                  y.isin(y[max(0, split_point - 1)] + fh.to_pandas())
              ).flatten()
              if split_point == 0:
                  test -= 1
          yield train, test
  
imports: from typing import Optional
  import numpy
  import pandas
  from sktime.datatypes._utilities import get_index_for_series
  from sktime.forecasting.base import ForecastingHorizon
  from sktime.split.base import BaseSplitter
  from sktime.split.base._common import ACCEPTED_Y_TYPES, FORECASTING_HORIZON_TYPES, SPLIT_ARRAY_TYPE, SPLIT_GENERATOR_TYPE, _check_fh, _check_inputs_for_compatibility, _get_end
  from sktime.utils.validation import ACCEPTED_WINDOW_LENGTH_TYPES, NON_FLOAT_WINDOW_LENGTH_TYPES, array_is_int, check_window_length, is_int, is_timedelta_or_date_offset
  from sktime.utils.validation.forecasting import check_step_length
label_desc: Use image node_id 6 for calling the BaseWindowSplitter obj's underlying member method code with example usage: obj._split_windows_generic(window_length, y, fh, expanding) without return types