class_docstr: Splitter that replicates loc indices from another splitter.
  
  Takes a splitter ``cv`` and a time series ``y_template``.
  Splits ``y`` in ``split`` and ``split_loc`` such that ``loc`` indices of splits
  are identical to loc indices of ``cv`` applied to ``y_template``.
  
  Parameters
  ----------
  cv : BaseSplitter
      splitter for which to replicate splits by ``loc`` index
  y_template : time series container of ``Series`` scitype, optional
      template used in ``cv`` to determine ``loc`` indices
      if None, ``y_template=y`` will be used in methods
  
  Examples
  --------
  >>> from sktime.datasets import load_airline
  >>> from sktime.split import (
  ...    ExpandingWindowSplitter,
  ...    SameLocSplitter,
  ... )
  
  >>> y = load_airline()
  >>> y_template = y[:60]
  >>> cv_tpl = ExpandingWindowSplitter(fh=[2, 4], initial_window=24, step_length=12)
  
  >>> splitter = SameLocSplitter(cv_tpl, y_template)
  
  these two are the same:
  
  >>> list(cv_tpl.split(y_template)) # doctest: +SKIP
  >>> list(splitter.split(y)) # doctest: +SKIP
class_docstr_tok: ["Splitter","that","replicates","loc","indices","from","another","splitter",".","Takes","a","splitter","``","cv","``","and","a","time","series","``","y_template","``",".","Splits","``","y","``","in","``","split","``","and","``","split_loc","``","such","that","``","loc","``","indices","of","splits","are","identical","to","loc","indices","of","``","cv","``","applied","to","``","y_template","``",".","Parameters","--","--","--","--","--","cv",":","BaseSplitter","splitter","for","which","to","replicate","splits","by","``","loc","``","index","y_template",":","time","series","container","of","``","Series","``","scitype",",","optional","template","used","in","``","cv","``","to","determine","``","loc","``","indices","if","None",",","``","y_template=y","``","will","be","used","in","methods","Examples","--","--","--","--",">",">",">","from","sktime.datasets","import","load_airline",">",">",">","from","sktime.split","import","(","...","ExpandingWindowSplitter",",","...","SameLocSplitter",",","...",")",">",">",">","y","=","load_airline","(",")",">",">",">","y_template","=","y","[",":60","]",">",">",">","cv_tpl","=","ExpandingWindowSplitter","(","fh=","[","2",",","4","]",",","initial_window=24",",","step_length=12",")",">",">",">","splitter","=","SameLocSplitter","(","cv_tpl",",","y_template",")","these","two","are","the","same",":",">",">",">","list","(","cv_tpl.split","(","y_template",")",")","#","doctest",":","+SKIP",">",">",">","list","(","splitter.split","(","y",")",")","#","doctest",":","+SKIP"]
code: def _split(self, y: pd.Index) -> SPLIT_GENERATOR_TYPE:
      cv = self.cv
      if self.y_template is None:
          y_template = y
      else:
          y_template = self.y_template
  
      for y_train_loc, y_test_loc in cv.split_loc(y_template):
          y_train_iloc = y.get_indexer(y_train_loc)
          y_test_iloc = y.get_indexer(y_test_loc)
          yield y_train_iloc, y_test_iloc
  
file_path: sktime/sktime/split/sameloc.py
imports: from typing import Optional
  import pandas
  from sktime.split.base import BaseSplitter
  from sktime.split.base._common import ACCEPTED_Y_TYPES, SPLIT_GENERATOR_TYPE
label_desc: Use image node_id 2 for calling the SameLocSplitter obj's underlying member method code with example usage: obj._split(y) without return types