code: def test_time_rule_series(
      series, compare_func, roll_func, kwargs, minp
  ):
      win = 25
      ser = series[::2].resample("B").mean()
      series_result = getattr(
          ser.rolling(window=win, min_periods=minp), roll_func
      )(**kwargs)
      last_date = series_result.index[-1]
      prev_date = last_date - 24 * offsets.BDay()
  
      trunc_series = series[::2].truncate(prev_date, last_date)
      tm.assert_almost_equal(
          series_result.iloc[-1], compare_func(trunc_series)
      )
  
imports: from datetime import datetime
  import numpy
  import pytest
  import pandas.util._test_decorators
  from pandas import DataFrame, DatetimeIndex, Series, concat, isna, notna
  import pandas._testing
  from pandas.tseries import offsets
label_desc: Use image node_id 3 for calling a global function with example usage: test_time_rule_series(series, compare_func, roll_func, kwargs, minp) without return types