code: def convert_metadata(exp_dir, out_dir):
      # Store the directory name this was converted from (which typically
      # would contain the experiment ID), but othewrise copy unchanged.
      with open(os.path.join(exp_dir, _METADATA_FILE)) as f:
          metadata = json.load(f)
      metadata["converted_from"] = os.path.basename(exp_dir)
      with open(
          os.path.join(out_dir, "converted_metadata.json"), mode="w"
      ) as f:
          json.dump(metadata, f)
  
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 2 for calling a global function with example usage: convert_metadata(exp_dir, out_dir) without return types