def METHOD_NAME(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
        )