code: def test_groupby_cum():
      df1 = pd.DataFrame(
          {
              "a": [3, 5, 2, 7, 1, 2, 4, 6, 2, 4],
              "b": [8, 3, 4, 1, 8, 2, 2, 2, 2, 3],
              "c": [1, 8, 8, 5, 3, 5, 0, 0, 5, 4],
          }
      )
      mdf = md.DataFrame(df1, chunk_size=3)
  
      for fun in ["cummin", "cummax", "cumprod", "cumsum"]:
          r = tile(getattr(mdf.groupby("b"), fun)())
          assert r.op.output_types[0] == OutputType.dataframe
          assert len(r.chunks) == 4
          assert r.shape == (len(df1), 2)
          assert r.chunks[0].shape == (np.nan, 2)
          pd.testing.assert_index_equal(
              r.chunks[0].columns_value.to_pandas(),
              pd.Index(["a", "c"]),
          )
  
          r = tile(getattr(mdf.groupby("b"), fun)(axis=1))
          assert r.op.output_types[0] == OutputType.dataframe
          assert len(r.chunks) == 4
          assert r.shape == (len(df1), 3)
          assert r.chunks[0].shape == (np.nan, 3)
          pd.testing.assert_index_equal(
              r.chunks[0].columns_value.to_pandas(), df1.columns
          )
  
      r = tile(mdf.groupby("b").cumcount())
      assert r.op.output_types[0] == OutputType.series
      assert len(r.chunks) == 4
      assert r.shape == (len(df1),)
      assert r.chunks[0].shape == (np.nan,)
  
      series1 = pd.Series([2, 2, 5, 7, 3, 7, 8, 8, 5, 6])
      ms1 = md.Series(series1, chunk_size=3)
  
      for fun in ["cummin", "cummax", "cumprod", "cumsum", "cumcount"]:
          r = tile(getattr(ms1.groupby(lambda x: x % 2), fun)())
          assert r.op.output_types[0] == OutputType.series
          assert len(r.chunks) == 4
          assert r.shape == (len(series1),)
          assert r.chunks[0].shape == (np.nan,)
  
imports: from collections import OrderedDict
  import numpy
  import pandas
  import pytest
  from ..sort import DataFrameGroupbySortShuffle
  from ....None import dataframe
  from ....None import opcodes
  from ....config import option_context
  from ....core import OutputType, tile
  from ....core.operand import OperandStage
  from ...core import DataFrameGroupBy, SeriesGroupBy, DataFrame
  from ..core import DataFrameGroupByOperand, DataFrameShuffleProxy
  from ..aggregation import DataFrameGroupByAgg
  from ..getitem import GroupByIndex
label_desc: Use image node_id 7 for calling a global function with example usage: test_groupby_cum() without return types