code: def test_rolling_methods(
      method, args, window, center, check_less_precise
  ):
      if check_less_precise:
          check_less_precise = {"atol": 1e-3, "rtol": 1e-3}
      else:
          check_less_precise = {}
      if method == "count":
          min_periods = 0
      else:
          min_periods = None
      # DataFrame
      prolling = df.rolling(
          window, center=center, min_periods=min_periods
      )
      drolling = ddf.rolling(
          window, center=center, min_periods=min_periods
      )
      if method == "apply":
          kwargs = {"raw": False}
      else:
          kwargs = {}
  
      assert_eq(
          getattr(prolling, method)(*args, **kwargs),
          getattr(drolling, method)(*args, **kwargs),
          **check_less_precise,
      )
  
      # Series
      prolling = df.a.rolling(
          window, center=center, min_periods=min_periods
      )
      drolling = ddf.a.rolling(
          window, center=center, min_periods=min_periods
      )
      assert_eq(
          getattr(prolling, method)(*args, **kwargs),
          getattr(drolling, method)(*args, **kwargs),
          **check_less_precise,
      )
  
imports: from __future__ import annotations
  import contextlib
  import datetime
  import numpy
  import pandas
  import pytest
  import dask.dataframe
  from dask.dataframe._compat import PANDAS_GE_210
  from dask.dataframe.utils import assert_eq
label_desc: Use image node_id 8 for calling a global function with example usage: test_rolling_methods(method, args, window, center, check_less_precise) without return types