code: def test_distributed_groupby_agg(setup_cluster):
      rs = np.random.RandomState(0)
      raw = pd.DataFrame(rs.rand(50000, 10))
      df = md.DataFrame(raw, chunk_size=raw.shape[0] // 2)
      with option_context({"chunk_store_limit": 1024**2}):
          r = df.groupby(0).sum(combine_size=1)
      result = r.execute().fetch()
      pd.testing.assert_frame_equal(result, raw.groupby(0).sum())
      # test use shuffle
      assert len(r._fetch_infos()["memory_size"]) > 1
  
      rs = np.random.RandomState(0)
      raw = pd.DataFrame(
          {
              "c1": rs.randint(20, size=100),
              "c2": rs.choice(["a", "b", "c"], (100,)),
              "c3": rs.rand(100),
          }
      )
      mdf = md.DataFrame(raw, chunk_size=20)
      r = mdf.groupby("c2").sum().execute()
      pd.testing.assert_frame_equal(r.fetch(), raw.groupby("c2").sum())
      # test use tree
      assert len(r._fetch_infos()["memory_size"]) == 1
  
      rs = np.random.RandomState(0)
      raw = pd.DataFrame(
          {
              "c1": rs.randint(20, size=100),
              "c2": rs.choice(["a", "b", "c"], (100,)),
              "c3": rs.rand(100),
          }
      )
      mdf = md.DataFrame(raw, chunk_size=10)
      with option_context({"chunk_store_limit": 2048}):
          r = mdf.groupby("c2", sort=False).sum().execute()
      pd.testing.assert_frame_equal(
          r.fetch().sort_index(),
          raw.groupby("c2", sort=False).sum().sort_index(),
      )
      # use tree and shuffle
      assert len(r._fetch_infos()["memory_size"]) == 3
  
imports: from collections import OrderedDict
  import numpy
  import pandas
  import pytest
  from ....None import dataframe
  from ....config import option_context
  from ....core.operand import OperandStage
  from ....tests.core import assert_groupby_equal, require_cudf
  from ....utils import arrow_array_to_objects, pd_release_version
  from ...core import DATAFRAME_OR_SERIES_TYPE
  from ..aggregation import DataFrameGroupByAgg
label_desc: Use image node_id 7 for calling a global function with example usage: test_distributed_groupby_agg(setup_cluster) without return types