code: def augment_sweep(sweep):
      """Augments sweep data with fields useful for analysis."""
      # Augment data with "aug" field
      for data in sweep:
          data["aug"] = {}
      # Augment with "aug.lr_wd" field = log(lr) + log(wd) = log(lr * wd)
      lrs, wds = get_vals(sweep, "lr"), get_vals(sweep, "wd")
      for data, lr, wd in zip(sweep, lrs, wds):
          data["aug"]["lr_wd"] = lr + wd
      # Augment with "aug.done" field
      epoch_ind = get_vals(sweep, "test_epoch.epoch_ind")
      epoch_max = get_vals(sweep, "test_epoch.epoch_max")
      for data, i, m in zip(sweep, epoch_ind, epoch_max):
          data["aug"]["done"] = i[-1] / m[-1]
      # Augment with "ema_gain"
      errors = get_vals(sweep, "test_epoch.min_top1_err")
      errors_ema = get_vals(sweep, "test_ema_epoch.min_top1_err")
      for data, error, error_ema in zip(sweep, errors, errors_ema):
          data["aug"]["ema_gain"] = max(0, min(error) - min(error_ema))
  
file_path: pycls/pycls/sweep/analysis.py
imports: import json
  from functools import reduce
  from operator import getitem
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: augment_sweep(sweep) without return types