code: def _cum_aggregate_apply(aggregate, x, y):
      """Apply aggregation function within a cumulative aggregation
  
      Parameters
      ----------
      aggregate: function (a, a) -> a
          The aggregation function, like add, which is used to and subsequent
          results
      x:
      y:
      """
      if y is None:
          return x
      else:
          return aggregate(x, y)
  
imports: from __future__ import annotations
  import warnings
  from functools import partial
  import numpy
  import pandas
  from pandas.api.types import is_extension_array_dtype
  from pandas.errors import PerformanceWarning
  from tlz import partition
  from dask.dataframe._compat import PANDAS_GE_131, PANDAS_GE_140, PANDAS_GE_200, check_apply_dataframe_deprecation, check_applymap_dataframe_deprecation, check_convert_dtype_deprecation, check_observed_deprecation
  from dask.dataframe.dispatch import concat, concat_dispatch, group_split_dispatch, hash_object_dispatch, is_categorical_dtype, is_categorical_dtype_dispatch, tolist, tolist_dispatch, union_categoricals
  from dask.dataframe.utils import is_dataframe_like, is_index_like, is_series_like
label_desc: Use image node_id 16 for calling a global function with example usage: _cum_aggregate_apply(aggregate, x, y) and returns: x, aggregate