code: def test_get_n_splits():
      """Tests get_n_splits and get_n_splits_without_capping"""
      X = np.random.rand(100, 3)
  
      # normal case, no capping
      tscv = RollingTimeSeriesSplit(
          forecast_horizon=10,
          min_train_periods=20,
          expanding_window=True,
          periods_between_splits=16,
          periods_between_train_test=3,
          max_splits=None,
      )
      assert tscv.get_n_splits(X=X) == 5
      assert tscv.get_n_splits_without_capping(X=X) == 5
  
      # normal case, no capping
      tscv = RollingTimeSeriesSplit(
          forecast_horizon=7,
          min_train_periods=30,
          expanding_window=False,
          periods_between_splits=30,
          periods_between_train_test=10,
          max_splits=None,
      )
      assert tscv.get_n_splits(X=X) == 2
      assert tscv.get_n_splits_without_capping(X=X) == 2
  
      # max_splits reached
      tscv = RollingTimeSeriesSplit(
          forecast_horizon=10,
          min_train_periods=20,
          expanding_window=True,
          periods_between_splits=16,
          periods_between_train_test=3,
          max_splits=4,
      )
      assert tscv.get_n_splits(X=X) == 4
      assert tscv.get_n_splits_without_capping(X=X) == 5
  
      # not enough data, use default_split
      tscv = RollingTimeSeriesSplit(
          forecast_horizon=10,
          min_train_periods=90,
          expanding_window=True,
          periods_between_splits=16,
          periods_between_train_test=3,
          max_splits=None,
      )
      assert tscv.get_n_splits(X=X) == 1
      assert tscv.get_n_splits_without_capping(X=X) == 0
  
file_path: greykite/greykite/tests/sklearn/test_cross_validation.py
imports: import numpy
  import pytest
  from greykite.sklearn.cross_validation import RollingTimeSeriesSplit
label_desc: Use image node_id 7 for calling a global function with example usage: test_get_n_splits() without return types