code: def test_custom_series_aggregate(setup, check_ref_counts):
      rs = np.random.RandomState(0)
      data = pd.Series(rs.rand(20))
  
      s = md.Series(data)
      result = s.agg(MockReduction1())
      assert result.execute().fetch() == data.agg(MockReduction1())
  
      result = s.agg(MockReduction2())
      assert result.execute().fetch() == data.agg(MockReduction2())
  
      s = md.Series(data, chunk_size=5)
      result = s.agg(MockReduction2())
      assert pytest.approx(result.execute().fetch()) == data.agg(
          MockReduction2()
      )
  
      result = s.agg(MockReduction2())
      assert pytest.approx(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 23 for calling a global function with example usage: test_custom_series_aggregate(setup, check_ref_counts) without return types