def METHOD_NAME(cls,
                    items: 'List[StatDict]',
                    agg_mode: str = AGG_DEFAULT,
                    ):
    """
    Aggregates array of `StatDict` items by a given `mode`
    """
    aggregated_stat = cls()
    # Return empty item if items array is empty
    if not items or len(items) == 0:
        return aggregated_stat
    gpu_stats = []
    for s in items:
        # Collect system stats
        for k in s.system.keys():
            aggregated_stat.system.setdefault(k, [])
            aggregated_stat.system[k].append(s.system[k])
        # Collect GPU device stats
        for stat_item_gpu_idx in range(len(s.gpus)):
            stat_item_gpu_stat = s.gpus[stat_item_gpu_idx]
            if len(gpu_stats) == stat_item_gpu_idx:
                gpu_stats.append({})
            for gpu_stat_key in stat_item_gpu_stat.keys():
                gpu_stat = stat_item_gpu_stat[gpu_stat_key]
                gpu_stats[stat_item_gpu_idx].setdefault(gpu_stat_key, [])
                gpu_stats[stat_item_gpu_idx][gpu_stat_key].append(gpu_stat)
    # Aggregate system stats
    for k in aggregated_stat.system.keys():
        aggregated_stat.system[k] = cls.aggregate(aggregated_stat.system[k],
                                                  agg_mode)
    # Aggregate GPU device stats
    for g in range(len(gpu_stats)):
        for k in gpu_stats[g].keys():
            gpu_stats[g][k] = cls.aggregate(gpu_stats[g][k], agg_mode)
    aggregated_stat.gpu = gpu_stats
    return aggregated_stat