code: def run(logdir):
      """Run custom scalar demo and generate event files."""
      tf.random.set_seed(0)
      writer = tf.summary.create_file_writer(logdir)
      with writer.as_default():
          for step in range(42):
              write_scalars(step)
          # We only need to specify the layout once (instead of per step).
          tf.summary.experimental.write_raw_pb(
              create_layout_summary().SerializeToString(), step=0
          )
  
file_path: tensorboard/tensorboard/plugins/custom_scalar/custom_scalar_demo.py
imports: from absl import app
  import tensorflow
  from tensorboard.plugins.custom_scalar import summary
  from tensorboard.plugins.custom_scalar import layout_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: run(logdir) without return types