code: def test_sliding_window_splitter_with_initial_window(
      y, fh, window_length, step_length, initial_window
  ):
      """Test SlidingWindowSplitter."""
      if _inputs_are_supported(
          [fh, initial_window, window_length, step_length]
      ):
          cv = SlidingWindowSplitter(
              fh=fh,
              window_length=window_length,
              step_length=step_length,
              initial_window=initial_window,
              start_with_window=True,
          )
          train_windows, test_windows, _, n_splits = _check_cv(cv, y)
  
          assert train_windows[0].shape[0] == _coerce_duration_to_int(
              duration=initial_window, freq="D"
          )
          assert np.vstack(train_windows[1:]).shape == (
              n_splits - 1,
              _coerce_duration_to_int(duration=window_length, freq="D"),
          )
          assert np.vstack(test_windows).shape == (
              n_splits,
              len(check_fh(fh)),
          )
      else:
          match = "Unsupported combination of types"
          with pytest.raises(TypeError, match=match):
              SlidingWindowSplitter(
                  fh=fh,
                  initial_window=initial_window,
                  window_length=window_length,
                  step_length=step_length,
                  start_with_window=True,
              )
  
file_path: sktime/sktime/split/tests/test_slidingwindow.py
imports: import numpy
  import pytest
  from sktime.forecasting.tests._config import TEST_FHS, TEST_FHS_TIMEDELTA, TEST_INITIAL_WINDOW, TEST_STEP_LENGTHS, TEST_WINDOW_LENGTHS, TEST_YS
  from sktime.split import SlidingWindowSplitter
  from sktime.split.base._common import _inputs_are_supported
  from sktime.split.tests.test_split import _check_cv, _get_n_incomplete_windows
  from sktime.utils._testing.series import _make_series
  from sktime.utils.datetime import _coerce_duration_to_int
  from sktime.utils.validation.forecasting import check_fh
label_desc: Use image node_id 2 for calling a global function with example usage: test_sliding_window_splitter_with_initial_window(y, fh, window_length, step_length, initial_window) without return types