code: def convert_scalars(exp_dir, out_dir):
      run_to_series = load_run_to_series(
          os.path.join(exp_dir, _SCALARS_FILE)
      )
      for run, series_list in run_to_series.items():
          w = create_writer_for_run(out_dir, run, "scalars")
          for series in series_list:
              tag = series["tag"]
              summary_metadata = base64.b64decode(
                  series["summary_metadata"]
              )
              points = zip(
                  series["points"]["steps"],
                  series["points"]["wall_times"],
                  series["points"]["values"],
              )
              first = True
              for step, wall_time, value in points:
                  e = Event(step=step, wall_time=wall_time)
                  e.summary.value.add(tag=tag, simple_value=value)
                  # For scalars, only write summary metadata once per tag.
                  # This keeps the file more compact and unlike tensors or blobs,
                  # scalars are easy to interpret even without any metadata.
                  if first:
                      e.summary.value[0].metadata.MergeFromString(
                          summary_metadata
                      )
                      first = False
                  w.add_event(e)
          w.close()
  
file_path: tensorboard/tensorboard/tools/convert_tbdev_export.py
imports: import argparse
  import base64
  import collections
  import json
  import logging
  import os
  import re
  import tempfile
  from tensorboard.compat.proto.event_pb2 import Event
  from tensorboard.compat.proto.summary_pb2 import Summary
  from tensorboard.summary.writer.event_file_writer import EventFileWriter
  from tensorboard.util import tensor_util
label_desc: Use image node_id 3 for calling a global function with example usage: convert_scalars(exp_dir, out_dir) without return types