code: def test_get_offset():
      """Tests _get_offset"""
      tscv = RollingTimeSeriesSplit(
          forecast_horizon=5,
          min_train_periods=10,
          periods_between_train_test=5,
          periods_between_splits=5,
      )
      assert (
          tscv._get_offset(X=np.random.rand(19, 1)) == 0
      )  # no CV splits
      assert tscv._get_offset(X=np.random.rand(20, 1)) == 0
      assert tscv._get_offset(X=np.random.rand(21, 1)) == 1
      assert tscv._get_offset(X=np.random.rand(22, 1)) == 2
      assert tscv._get_offset(X=np.random.rand(23, 1)) == 3
      assert tscv._get_offset(X=np.random.rand(24, 1)) == 4
      assert (
          tscv._get_offset(X=np.random.rand(25, 1)) == 0
      )  # perfect alignment again, last data point is used
  
      tscv = RollingTimeSeriesSplit(
          forecast_horizon=3,
          min_train_periods=6,
          periods_between_train_test=11,
          periods_between_splits=3,
      )
      assert tscv._get_offset(X=np.random.rand(20, 1)) == 0
      assert tscv._get_offset(X=np.random.rand(21, 1)) == 1
      assert tscv._get_offset(X=np.random.rand(22, 1)) == 2
      assert tscv._get_offset(X=np.random.rand(23, 1)) == 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 8 for calling a global function with example usage: test_get_offset() without return types