code: def test_custom_dataframe_aggregate(setup, check_ref_counts):
      rs = np.random.RandomState(0)
      data = pd.DataFrame(rs.rand(30, 20))
  
      df = md.DataFrame(data)
      result = df.agg(MockReduction1())
      pd.testing.assert_series_equal(
          result.execute().fetch(), data.agg(MockReduction1())
      )
  
      result = df.agg(MockReduction2())
      pd.testing.assert_series_equal(
          result.execute().fetch(), data.agg(MockReduction2())
      )
  
      df = md.DataFrame(data, chunk_size=5)
      result = df.agg(MockReduction2())
      pd.testing.assert_series_equal(
          result.execute().fetch(), data.agg(MockReduction2())
      )
  
      result = df.agg(MockReduction2())
      pd.testing.assert_series_equal(
          result.execute().fetch(), data.agg(MockReduction2())
      )
  
imports: from typing import NamedTuple
  import numpy
  import pytest
  import pandas
  from ....None import dataframe
  from ....config import option_context
  from ....session import get_default_session
  from ....tests.core import require_cudf, require_cupy
  from ....utils import lazy_import, pd_release_version
  from ...None import CustomReduction, NamedAgg
  from ...base import to_gpu
label_desc: Use image node_id 22 for calling a global function with example usage: test_custom_dataframe_aggregate(setup, check_ref_counts) without return types