code: def test_expanding_greedy_splitter_dates():
      """Test that ExpandingGreedySplitter splits on dates correctly."""
      ts = _make_series(index_type="period")
      first_date = ts.index[0]
      last_date = ts.index[-1]
      cv = ExpandingGreedySplitter(test_size=2, folds=3)
  
      train_starts = []
      train_ends = []
      test_starts = []
      test_ends = []
  
      for trn, tst in cv.split_series(ts):
          train_starts.append(trn.index[0])
          train_ends.append(trn.index[-1])
          test_starts.append(tst.index[0])
          test_ends.append(tst.index[-1])
  
      assert train_starts == [first_date, first_date, first_date]
      assert train_ends == [last_date - 6, last_date - 4, last_date - 2]
      assert test_starts == [
          last_date - 5,
          last_date - 3,
          last_date - 1,
      ]
      assert test_ends == [last_date - 4, last_date - 2, last_date]
  
file_path: sktime/sktime/split/tests/test_expandinggreedy.py
imports: import numpy
  import pandas
  from sktime.split import ExpandingGreedySplitter
  from sktime.utils._testing.hierarchical import _make_hierarchical
  from sktime.utils._testing.series import _make_series
label_desc: Use image node_id 2 for calling a global function with example usage: test_expanding_greedy_splitter_dates() without return types