code: def test_frame(raw, frame, compare_func, roll_func, kwargs, step):
      result = getattr(frame.rolling(50, step=step), roll_func)(
          **kwargs
      )
      assert isinstance(result, DataFrame)
      end = range(0, len(frame), step or 1)[-1] + 1
      tm.assert_series_equal(
          result.iloc[-1, :],
          frame.iloc[end - 50 : end, :].apply(
              compare_func, axis=0, raw=raw
          ),
          check_names=False,
      )
  
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 2 for calling a global function with example usage: test_frame(raw, frame, compare_func, roll_func, kwargs, step) without return types