code: def test_series_groupby_agg(setup):
      rs = np.random.RandomState(0)
      series1 = pd.Series(rs.rand(10))
      ms1 = md.Series(series1, chunk_size=3)
  
      agg_funs = [
          "std",
          "mean",
          "var",
          "max",
          "count",
          "size",
          "all",
          "any",
          "skew",
          "kurt",
          "sem",
      ]
  
      for method in ["tree", "shuffle"]:
          for agg_fun in agg_funs:
              r = ms1.groupby(lambda x: x % 2).agg(
                  agg_fun, method=method
              )
              pd.testing.assert_series_equal(
                  r.execute().fetch(),
                  series1.groupby(lambda x: x % 2).agg(agg_fun),
              )
  
          r = ms1.groupby(lambda x: x % 2).agg(agg_funs, method=method)
          pd.testing.assert_frame_equal(
              r.execute().fetch(),
              series1.groupby(lambda x: x % 2).agg(agg_funs),
          )
  
          # test groupby series
          r = ms1.groupby(ms1).sum(method=method)
          pd.testing.assert_series_equal(
              r.execute().fetch().sort_index(),
              series1.groupby(series1).sum().sort_index(),
          )
  
          r = ms1.groupby(ms1).sum(method=method)
          pd.testing.assert_series_equal(
              r.execute().fetch().sort_index(),
              series1.groupby(series1).sum().sort_index(),
          )
  
      # test inserted kurt method
      r = ms1.groupby(ms1).kurtosis(method="tree")
      pd.testing.assert_series_equal(
          r.execute().fetch(), series1.groupby(series1).kurtosis()
      )
  
      for agg_fun in agg_funs:
          r = getattr(ms1.groupby(lambda x: x % 2), agg_fun)(
              method="tree"
          )
          pd.testing.assert_series_equal(
              r.execute().fetch(),
              getattr(series1.groupby(lambda x: x % 2), agg_fun)(),
          )
  
      r = ms1.groupby(lambda x: x % 2).agg(
          ["cumsum", "cumcount"], method="tree"
      )
      pd.testing.assert_frame_equal(
          r.execute().fetch().sort_index(),
          series1.groupby(lambda x: x % 2)
          .agg(["cumsum", "cumcount"])
          .sort_index(),
      )
  
      r = ms1.groupby(lambda x: x % 2).agg(
          col_var="var", col_skew="skew", method="tree"
      )
      pd.testing.assert_frame_equal(
          r.execute().fetch(),
          series1.groupby(lambda x: x % 2).agg(
              col_var="var", col_skew="skew"
          ),
      )
  
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 5 for calling a global function with example usage: test_series_groupby_agg(setup) without return types