code: def test_time_stroll_indexing():
      s = pd.Series(data=[0, 1, 2, 3, 4], name="dummy")
      time_index = pd.date_range("2020-01-01", freq="1h", periods=5)
      s.index = time_index
  
      def get_time_index(arr):
          return [time_index[idx] for idx in arr]
  
      ## No Force
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(3, unit="h"),
          strides=[pd.Timedelta(1, unit="h")],
          window_idx="begin",
      )
      assert np.all(sr.index == get_time_index([0, 1]))
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(3, unit="h"),
          strides=[pd.Timedelta(2, unit="h")],
          window_idx="begin",
      )
      assert np.all(sr.index == get_time_index([0]))
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(3, unit="h"),
          strides=[pd.Timedelta(3, unit="h")],
          window_idx="begin",
      )
      assert np.all(sr.index == get_time_index([0]))
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(3, unit="h"),
          strides=[pd.Timedelta(4, unit="h")],
          window_idx="begin",
      )
      assert np.all(sr.index == get_time_index([0]))
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(3, unit="h"),
          strides=[pd.Timedelta(5, unit="h")],
          window_idx="begin",
      )
      assert np.all(sr.index == get_time_index([0]))
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(3, unit="h"),
          strides=[pd.Timedelta(50, unit="h")],
          window_idx="begin",
      )
      assert np.all(sr.index == get_time_index([0]))
  
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(4, unit="h"),
          strides=[pd.Timedelta(1, unit="h")],
          window_idx="begin",
      )
      assert np.all(sr.index == get_time_index([0]))
  
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(5, unit="h"),
          strides=[pd.Timedelta(1, unit="h")],
          window_idx="begin",
      )
      assert np.all(sr.index == [])
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(5, unit="h"),
          strides=[pd.Timedelta(2, unit="h")],
          window_idx="begin",
      )
      assert np.all(sr.index == [])
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(6, unit="h"),
          strides=[pd.Timedelta(1, unit="h")],
          window_idx="begin",
      )
      assert np.all(sr.index == [])
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(6, unit="h"),
          strides=[pd.Timedelta(2, unit="h")],
          window_idx="begin",
      )
      assert np.all(sr.index == [])
  
      ## Force
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(3, unit="h"),
          strides=[pd.Timedelta(1, unit="h")],
          window_idx="begin",
          include_final_window=True,
      )
      assert np.all(sr.index == get_time_index([0, 1, 2]))
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(3, unit="h"),
          strides=[pd.Timedelta(2, unit="h")],
          window_idx="begin",
          include_final_window=True,
      )
      assert np.all(sr.index == get_time_index([0, 2]))
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(3, unit="h"),
          strides=[pd.Timedelta(4, unit="h")],
          window_idx="begin",
          include_final_window=True,
      )
      assert np.all(sr.index == get_time_index([0, 4]))
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(3, unit="h"),
          strides=[pd.Timedelta(5, unit="h")],
          window_idx="begin",
          include_final_window=True,
      )
      assert np.all(sr.index == get_time_index([0]))
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(3, unit="h"),
          strides=[pd.Timedelta(50, unit="h")],
          window_idx="begin",
          include_final_window=True,
      )
      assert np.all(sr.index == get_time_index([0]))
  
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(4, unit="h"),
          strides=[pd.Timedelta(1, unit="h")],
          window_idx="begin",
          include_final_window=True,
      )
      assert np.all(sr.index == get_time_index([0, 1]))
  
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(5, unit="h"),
          strides=[pd.Timedelta(1, unit="h")],
          window_idx="begin",
          include_final_window=True,
      )
      assert np.all(sr.index == get_time_index([0]))
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(5, unit="h"),
          strides=[pd.Timedelta(2, unit="h")],
          window_idx="begin",
          include_final_window=True,
      )
      assert np.all(sr.index == get_time_index([0]))
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(6, unit="h"),
          strides=[pd.Timedelta(1, unit="h")],
          window_idx="begin",
          include_final_window=True,
      )
      assert np.all(sr.index == get_time_index([0]))
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(6, unit="h"),
          strides=[pd.Timedelta(2, unit="h")],
          window_idx="begin",
          include_final_window=True,
      )
      assert np.all(sr.index == get_time_index([0]))
  
imports: import numpy
  import pandas
  import pytest
  from tsflex.features import FuncWrapper
  from tsflex.features.segmenter.strided_rolling import SequenceStridedRolling, StridedRolling, TimeIndexSampleStridedRolling, TimeStridedRolling
  from .utils import dummy_data
label_desc: Use image node_id 8 for calling a global function with example usage: test_time_stroll_indexing() and returns: unknown