code: def _log_timeline(run_metadata, name="timeline", step=0):
      fetched_timeline = timeline.Timeline(run_metadata.step_stats)
      chrome_trace = fetched_timeline.generate_chrome_trace_format()
      directory = os.path.join(
          autodist.const.DEFAULT_WORKING_DIR, "traces"
      )
      os.makedirs(directory, exist_ok=True)
      # TODO(Hao): add a runner step count and use it here.
      p = os.path.join(directory, "{}_{}.json".format(name, step))
      with open(p, "w") as f:
          f.write(chrome_trace)
          logging.info("Traced timeline written to: %s" % p)
  
file_path: autodist/autodist/runner.py
imports: import hashlib
  import os
  from tensorflow.core.protobuf import config_pb2, rewriter_config_pb2
  from tensorflow.python.client import timeline, session
  import autodist.autodist
  import autodist.const
  from autodist.const import ENV, MAX_INT32
  from autodist.utils import logging
label_desc: Use image node_id 3 for calling a global function with example usage: _log_timeline(run_metadata, name, step) without return types