code: def save(logdir, result):
      """Save profile result to TensorBoard logdir.
  
      Args:
        logdir: log directory read by TensorBoard.
        result: profiling result returned by stop().
      """
      plugin_dir = os.path.join(
          logdir,
          "plugins",
          "profile",
          datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S"),
      )
      gfile.MakeDirs(plugin_dir)
      maybe_create_event_file(logdir)
      with gfile.Open(
          os.path.join(plugin_dir, "local.trace"), "wb"
      ) as f:
          f.write(result)
  
imports: import datetime
  import os
  import threading
  from tensorflow.python.client import _pywrap_events_writer
  from tensorflow.python.eager import context
  from tensorflow.python.framework import errors
  from tensorflow.python.platform import gfile
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.profiler.internal import _pywrap_profiler
  from tensorflow.python.util import compat
  from tensorflow.python.util.deprecation import deprecated
label_desc: Use image node_id 4 for calling a global function with example usage: save(logdir, result) without return types