code: def _tree_node_agg(df, gb_cols, dropna, sort, sep):
      """Node in groupby-aggregation reduction tree.
  
      The input DataFrame (`df`) corresponds to the
      concatenated output of one or more `_groupby_partition_agg`
      tasks. In this function, "sum", "min" and/or "max" groupby
      aggregations will be used to combine the statistics for
      duplicate keys.
      """
  
      agg_dict = {}
      for col in df.columns:
          if col in gb_cols:
              continue
          agg = col.split(sep)[-1]
          if agg in ("count", "sum"):
              agg_dict[col] = ["sum"]
          elif agg in OPTIMIZED_AGGS:
              agg_dict[col] = [agg]
          else:
              raise ValueError(f"Unexpected aggregation: {agg}")
  
      gb = df.groupby(
          gb_cols, dropna=dropna, as_index=False, sort=sort
      ).agg(agg_dict)
  
      # Don't include the last aggregation in the column names
      output_columns = [
          _make_name(
              name[:-1] if isinstance(name, tuple) else 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 10 for calling a global function with example usage: _tree_node_agg(df, gb_cols, dropna, sort, sep) and returns: gb