code: def create_tb_writer(outdir):
      """Return a tensorboard summarywriter with a custom scalar."""
      # This conditional import will raise an error if tensorboard<1.14
      from torch.utils.tensorboard import SummaryWriter
  
      tb_writer = SummaryWriter(log_dir=outdir)
      layout = {
          "Aggregate Charts": {
              "mean w/ min-max": [
                  "Margin",
                  ["eval/mean", "eval/min", "eval/max"],
              ],
              "mean +/- std": [
                  "Margin",
                  [
                      "eval/mean",
                      "extras/meanplusstdev",
                      "extras/meanminusstdev",
                  ],
              ],
          }
      }
      tb_writer.add_custom_scalars(layout)
      return tb_writer
  
imports: import logging
  import multiprocessing
  import os
  import statistics
  import time
  import numpy
  import pfrl
label_desc: Use image node_id 7 for calling a global function with example usage: create_tb_writer(outdir) and returns: tb_writer