code: def test_same_loc_splitter():
      """Test that SameLocSplitter works as intended."""
      from sktime.datasets import load_airline
  
      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 should be the same
      # not in general, but only because y is longer only at the end
      split_template_iloc = list(cv_tpl.split(y_template))
      split_templated_iloc = list(splitter.split(y))
  
      for (t1, tt1), (t2, tt2) in zip(
          split_template_iloc, split_templated_iloc
      ):
          assert np.all(t1 == t2)
          assert np.all(tt1 == tt2)
  
      # these should be in general the same
      split_template_loc = list(cv_tpl.split_loc(y_template))
      split_templated_loc = list(splitter.split_loc(y))
  
      for (t1, tt1), (t2, tt2) in zip(
          split_template_loc, split_templated_loc
      ):
          assert np.all(t1 == t2)
          assert np.all(tt1 == tt2)
  
imports: import numpy
  from sktime.split import ExpandingWindowSplitter, SameLocSplitter
  from sktime.utils._testing.hierarchical import _make_hierarchical
label_desc: Use image node_id 1 for calling a global function with example usage: test_same_loc_splitter() without return types