code: def describe_sweep(sweep, reverse=False):
      """Generate a string description of sweep."""
      keys = ["error_ema", "error_tst", "done", "log_file", "cfg.DESC"]
      formats = ["ema={:.2f}", "err={:.2f}", "done={:.2f}", "{}", "{}"]
      vals = [get_vals(sweep, key) for key in keys]
      vals[3] = [v.split("/")[-2] for v in vals[3]]
      desc = [" | ".join(formats).format(*val) for val in zip(*vals)]
      desc = [s for _, s in sorted(zip(vals[0], desc), reverse=reverse)]
      return "\n".join(desc)
  
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 4 for calling a global function with example usage: describe_sweep(sweep, reverse) and returns: str