docstr: Aggregates array of numbers by a given 'mode'
docstr_tok: ["Aggregates","array","of","numbers","by","a","given","'mode","'"]
code: def aggregate(cls, items: List, mode: str):
      """
      Aggregates array of numbers by a given 'mode'
      """
      if mode == cls.AGG_MODE_MAX:
          return max(items)
      elif mode == cls.AGG_MODE_MIN:
          return min(items)
      elif mode == cls.AGG_MODE_AVG:
          return round10e5(sum(items) / len(items))
      elif mode == cls.AGG_MODE_DIFF:
          return round10e5(max(items) - min(items))
      else:
          raise ValueError(
              "unknown aggregation mode: '{}'".format(mode)
          )
  
file_path: aim/aim/ext/resource/stat.py
imports: import psutil
  import json
  from typing import List
  from aim.ext.resource.utils import round10e5
  import aim.ext.pynvml
label_desc: Use image node_id 1 for calling the StatDict obj's underlying member method code with example usage: obj.aggregate(cls, items, mode) and returns: max, min, round10e5, round10e5