code: def test_split_series():
      """
      test all modes on a naive list of from 0 to 99
      """
      s = pd.Series(range(100))
  
      splits = split_train_test(s, mode=1, n_splits=4, train_ratio=0.8)
      ts_train, ts_test = zip(*splits)
      assert all(
          x.equals(y)
          for x, y in zip(
              ts_train,
              [
                  s.iloc[:20],
                  s.iloc[25:45],
                  s.iloc[50:70],
                  s.iloc[75:95],
              ],
          )
      )
      assert all(
          x.equals(y)
          for x, y in zip(
              ts_test,
              [
                  s.iloc[20:25],
                  s.iloc[45:50],
                  s.iloc[70:75],
                  s.iloc[95:],
              ],
          )
      )
  
      splits = split_train_test(s, mode=2, n_splits=4, train_ratio=0.8)
      ts_train, ts_test = zip(*splits)
      assert all(
          x.equals(y)
          for x, y in zip(
              ts_train,
              [s.iloc[:20], s.iloc[:40], s.iloc[:60], s.iloc[:80]],
          )
      )
      assert all(
          x.equals(y)
          for x, y in zip(
              ts_test,
              [
                  s.iloc[20:25],
                  s.iloc[40:50],
                  s.iloc[60:75],
                  s.iloc[80:],
              ],
          )
      )
  
      splits = split_train_test(s, mode=3, n_splits=4, train_ratio=0.8)
      ts_train, ts_test = zip(*splits)
      assert all(
          x.equals(y)
          for x, y in zip(
              ts_train,
              [s.iloc[:20], s.iloc[:40], s.iloc[:60], s.iloc[:80]],
          )
      )
      assert all(
          x.equals(y)
          for x, y in zip(
              ts_test,
              [
                  s.iloc[20:40],
                  s.iloc[40:60],
                  s.iloc[60:80],
                  s.iloc[80:],
              ],
          )
      )
  
      splits = split_train_test(s, mode=4, n_splits=4, train_ratio=0.8)
      ts_train, ts_test = zip(*splits)
      assert all(
          x.equals(y)
          for x, y in zip(
              ts_train,
              [s.iloc[:20], s.iloc[:40], s.iloc[:60], s.iloc[:80]],
          )
      )
      assert all(
          x.equals(y)
          for x, y in zip(
              ts_test,
              [s.iloc[20:], s.iloc[40:], s.iloc[60:], s.iloc[80:]],
          )
      )
  
imports: import numpy
  import pandas
  from adtk.data import split_train_test
label_desc: Use image node_id 1 for calling a global function with example usage: test_split_series() without return types