code: def _summarize_scalars(reader):
      summarized = {}
      for tag, val, step in reader:
          # Don't use dict.setdefault to avoid repeated calls to
          # TagSummary.
          try:
              tag_summary = summarized[tag]
          except KeyError:
              summarized[tag] = tag_summary = TagSummary()
          tag_summary.add(val, step)
      return summarized
  
imports: import logging
  import os
  import sqlite3
  from guild import run_util
  from guild import tfevent
  from guild import util
  from guild import var
label_desc: Use image node_id 9 for calling a global function with example usage: _summarize_scalars(reader) and returns: summarized