code: def test_split_loc():
      """Tests that split_loc produces loc indices for train and test."""
      y = _make_series()
      cv = SlidingWindowSplitter()
  
      for train, test in cv.split_loc(y):
          assert isinstance(train, pd.DatetimeIndex)
          assert len(train) == 10
          y.loc[train]
          assert isinstance(test, pd.DatetimeIndex)
          assert len(test) == 1
          y.loc[test]
  
file_path: sktime/sktime/split/base/tests/test_base.py
imports: import numpy
  import pandas
  import pytest
  from sktime.forecasting.tests._config import TEST_FHS, TEST_FHS_TIMEDELTA, TEST_STEP_LENGTHS, TEST_WINDOW_LENGTHS
  from sktime.split.base._common import _inputs_are_supported
  from sktime.split.expandingwindow import ExpandingWindowSplitter
  from sktime.split.singlewindow import SingleWindowSplitter
  from sktime.split.slidingwindow import SlidingWindowSplitter
  from sktime.utils._testing.hierarchical import _make_hierarchical
  from sktime.utils._testing.panel import _make_panel
  from sktime.utils._testing.series import _make_series
label_desc: Use image node_id 2 for calling a global function with example usage: test_split_loc() without return types