code: def main(argv=None):
      import matplotlib.pyplot as plt
  
      parser = argparse.ArgumentParser()
      parser.add_argument(
          "--backends",
          default=["joblib", "singleexecutor"],
          nargs="+",
          type=str,
          help="Executor backends to use during the tests.",
      )
      parser.add_argument(
          "--n-base-trials",
          default=498,
          type=int,
          help=(
              "Number of trials to produce before starting the test. "
              "This measures the effect on I/O of last history in DB"
          ),
      )
      parser.add_argument(
          "--n-trials",
          default=2,
          type=int,
          help="Number of trials to execute during the test.",
      )
      parser.add_argument(
          "--trial-duration",
          default=30,
          type=float,
          help="Duration of trial execution (in seconds).",
      )
      parser.add_argument(
          "--output",
          default="test-io.png",
          type=str,
          help="File name to save figure.",
      )
  
      options = parser.parse_args(argv)
  
      for backend in options.backends:
          with OrionState():
              net_in, net_out, n_trials = compute_stats(
                  monitoring_method="ptera",
                  executor=backend,
                  max_trials=(
                      options.n_base_trials,
                      options.n_base_trials + options.n_trials,
                  ),
                  sleep_time=options.trial_duration,
              )
  
          net_in = numpy.array(net_in)
          net_out = numpy.array(net_out)
  
          print(f"Backend: {backend}")
          print(
              f"Input: min={net_in.min()}, max={net_in.max()}, "
              f"mean={net_in.mean()}, std={net_in.std()}"
          )
          print(
              f"Output: min={net_out.min()}, max={net_out.max()}, "
              f"mean={net_out.mean()}, std={net_out.std()}"
          )
  
          max_points = min(map(len, [net_in, net_out, n_trials]))
          plt.plot(
              list(range(max_points)),
              net_in[:max_points],
              label=f"{backend}-in",
              color=colors[backend],
              linestyle="dashed",
          )
          plt.plot(
              list(range(max_points)),
              net_out[:max_points],
              label=f"{backend}-out",
              color=colors[backend],
          )
  
      plt.xlabel("Time (s)")
      plt.ylabel("I/O (KB/s)")
  
      plt.legend()
      plt.savefig(options.output)
  
imports: import argparse
  import contextlib
  import multiprocessing
  import subprocess
  import sys
  import time
  from collections import defaultdict, namedtuple
  import bson
  import numpy
  from ptera import probing
  from orion.client import build_experiment
  from orion.client.runner import Runner
  from orion.core.io.database.pickleddb import PickledDB
  from orion.testing import OrionState
label_desc: Use image node_id 16 for calling a global function with example usage: main(argv) without return types