code: def _get_tensorboard_scalars(path):
      """Read and parse scalar TensorBoard summaries.
  
      Args:
        path: str. Path containing TensorBoard event files.
  
      Returns:
        Dictionary mapping summary tags (str) to lists of
        (wall_time, step, scalar) tuples.
      """
      gen = _make_events_generator(path)
      data = filter(lambda x: x.HasField("summary"), gen)
      data = itertools.chain.from_iterable(map(_process_event, data))
  
      data_by_key = {}
      for tag, wall_time, step, value in data:
          if not tag in data_by_key:
              data_by_key[tag] = []
          data_by_key[tag].append((wall_time, step, value))
      return data_by_key
  
imports: import functools
  import inspect
  import itertools
  import json
  import os
  import tempfile
  from typing import Dict
  from absl import flags, logging
  from absl.testing import absltest
  from tensorboard.backend.event_processing import directory_watcher, event_file_loader, io_wrapper
  from tensorboard.summary import v1
  from tensorboard.util import tensor_util
  from flax import io
label_desc: Use image node_id 4 for calling a global function with example usage: _get_tensorboard_scalars(path) and returns: data_by_key