code: def _aggs_optimized(arg, supported: set):
      """Check that aggregations in `arg` are a subset of `supported`"""
      if isinstance(arg, (list, dict)):
          if isinstance(arg, dict):
              _global_set: Set[str] = set()
              for col in arg:
                  if isinstance(arg[col], list):
                      _global_set = _global_set.union(set(arg[col]))
                  elif isinstance(arg[col], dict):
                      _global_set = _global_set.union(
                          set(arg[col].values())
                      )
                  else:
                      _global_set.add(arg[col])
          else:
              _global_set = set(arg)
  
          return bool(_global_set.issubset(supported))
      elif isinstance(arg, str):
          return arg in supported
      return False
  
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 6 for calling a global function with example usage: _aggs_optimized(arg, supported) and returns: False, bool, unknown