code: def test_time_stroll_apply_func_vectorized_segment_idxs():
      f = FuncWrapper(np.min, output_names="min")
      f_vect = FuncWrapper(
          np.min, output_names="min_vect", vectorized=True, axis=-1
      )
  
      s = pd.Series(data=np.arange(20), name="dummy")
      s.index = pd.date_range("2020-01-01", freq="1h", periods=20)
      segment_idxs = s.index[[3, 6, 9]].values
  
      def assert_1col_df_equal(s1, s2):
          assert (s1.shape[1] == 1) & (s2.shape[1] == 1)
          assert np.all(s1.index == s2.index)
          assert np.all(s1.values.ravel() == s2.values.ravel())
  
      ### START IDXS
  
      ## No Force
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(3, unit="h"),
          segment_start_idxs=segment_idxs,
          window_idx="begin",
      )
      assert_1col_df_equal(sr.apply_func(f), sr.apply_func(f_vect))
  
      ## Force
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(3, unit="h"),
          segment_start_idxs=segment_idxs,
          window_idx="begin",
          include_final_window=True,
      )
      assert_1col_df_equal(sr.apply_func(f), sr.apply_func(f_vect))
  
      with pytest.raises(Exception):
          # Because of irregular stride step in the segment_start_idxs
          segment_start_idxs = s.index[[0, 2, 3]].values
          sr = SequenceStridedRolling(
              s,
              window=3,
              segment_start_idxs=segment_start_idxs,
              window_idx="begin",
          )
          sr.apply_func(f_vect)
  
      ### END IDXS
  
      ## No Force
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(3, unit="h"),
          segment_end_idxs=segment_idxs,
          window_idx="begin",
      )
      assert_1col_df_equal(sr.apply_func(f), sr.apply_func(f_vect))
  
      ## Force
      sr = TimeStridedRolling(
          s,
          window=pd.Timedelta(3, unit="h"),
          segment_end_idxs=segment_idxs,
          window_idx="begin",
          include_final_window=True,
      )
      assert_1col_df_equal(sr.apply_func(f), sr.apply_func(f_vect))
  
      with pytest.raises(Exception):
          # Because of irregular stride step in the segment_end_idxs
          segment_end_idxs = s.index[[0, 2, 3]].values
          sr = SequenceStridedRolling(
              s,
              window=3,
              segment_end_idxs=segment_end_idxs,
              window_idx="begin",
          )
          sr.apply_func(f_vect)
  
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 22 for calling a global function with example usage: test_time_stroll_apply_func_vectorized_segment_idxs() without return types