code: def _groupby_partition_agg(
      df, gb_cols, aggs, columns, dropna, sort, sep
  ):
      """Initial partition-level aggregation task.
  
      This is the first operation to be executed on each input
      partition in `groupby_agg`.  Depending on `aggs`, four possible
      groupby aggregations ("count", "sum", "min", and "max") are
      performed.  The result is then partitioned (by hashing `gb_cols`)
      into a number of distinct dictionary elements.  The number of
      elements in the output dictionary (`split_out`) corresponds to
      the number of partitions in the final output of `groupby_agg`.
      """
  
      # Modify dict for initial (partition-wise) aggregations
      _agg_dict = {}
      for col, agg_list in aggs.items():
          _agg_dict[col] = set()
          for agg in agg_list:
              if agg in ("mean", "std", "var"):
                  _agg_dict[col].add("count")
                  _agg_dict[col].add("sum")
              else:
                  _agg_dict[col].add(agg)
          _agg_dict[col] = list(_agg_dict[col])
          if set(agg_list).intersection({"std", "var"}):
              pow2_name = _make_name((col, "pow2"), sep=sep)
              df[pow2_name] = df[col].astype("float64").pow(2)
              _agg_dict[pow2_name] = ["sum"]
  
      gb = df.groupby(
          gb_cols, dropna=dropna, as_index=False, sort=sort
      ).agg(_agg_dict)
      output_columns = [
          _make_name(name, sep=sep) for name in gb.columns
      ]
      gb.columns = output_columns
      # Return with deterministic column ordering
      return gb[sorted(output_columns)]
  
imports: from functools import wraps
  from typing import Set
  import numpy
  import pandas
  from dask.dataframe.core import DataFrame, aca, split_out_on_cols
  from dask.dataframe.groupby import DataFrameGroupBy, SeriesGroupBy
  from dask.utils import funcname
  import cudf
  from cudf.utils.nvtx_annotation import _dask_cudf_nvtx_annotate
  from dask_cudf.sorting import _deprecate_shuffle_kwarg
label_desc: Use image node_id 9 for calling a global function with example usage: _groupby_partition_agg(df, gb_cols, aggs, columns, dropna, sort, sep) and returns: gb