code: def test_when_splitter_splits_then_all_folds_have_expected_length(
      prediction_length, num_val_windows, val_step_size
  ):
      original_df = DUMMY_VARIABLE_LENGTH_TS_DATAFRAME.copy()
      original_lengths = original_df.num_timesteps_per_item()
      splitter = ExpandingWindowSplitter(
          prediction_length=prediction_length,
          num_val_windows=num_val_windows,
          val_step_size=val_step_size,
      )
  
      for window_idx, (train_fold, val_fold) in enumerate(
          splitter.split(original_df)
      ):
          for item_id in original_df.item_ids:
              expected_val_length = (
                  original_lengths.loc[item_id]
                  - (num_val_windows - 1 - window_idx) * val_step_size
              )
              assert expected_val_length == len(val_fold.loc[item_id])
  
              expected_train_length = (
                  expected_val_length - prediction_length
              )
              assert expected_train_length == len(
                  train_fold.loc[item_id]
              )
  
file_path: autogluon/timeseries/tests/unittests/test_splitter.py
imports: import pytest
  from autogluon.timeseries.splitter import ExpandingWindowSplitter
  from .common import DATAFRAME_WITH_COVARIATES, DATAFRAME_WITH_STATIC, DUMMY_VARIABLE_LENGTH_TS_DATAFRAME
label_desc: Use image node_id 5 for calling a global function with example usage: test_when_splitter_splits_then_all_folds_have_expected_length(prediction_length, num_val_windows, val_step_size) without return types