code: def plot_certified_accuracy_per_sigma_against_baseline(
      outfile: str,
      title: str,
      max_radius: float,
      methods: List[Line] = None,
      label="Ours",
      methods_base: List[Line] = None,
      label_base="Baseline",
      radius_step: float = 0.01,
      upper_bounds=False,
  ) -> None:
      color = ["b", "orange", "g", "r"]
  
      sigmas = [0.12, 0.25, 0.5, 1.00]
      if "api" in outfile:
          sigmas = [0.12, 0.25]
  
      for it, sigma in enumerate(sigmas):
          methods_sigma = [
              method
              for method in methods
              if "{:.2f}".format(sigma)
              in method.quantity.data_file_path
          ]
          accuracies_cert_ours, radii = _get_accuracies_at_radii(
              methods_sigma, 0, max_radius, radius_step
          )
          plt.plot(
              radii,
              accuracies_cert_ours.max(0),
              color[it],
              label="{}|$\sigma = {:.2f}$".format(label, sigma),
          )
  
      for it, line in enumerate(methods_base):
          plt.plot(
              radii * line.scale_x,
              line.quantity.at_radii(radii),
              color[it],
              dashes=[2, 2],
              alpha=line.alpha,
              label="{}|".format(label_base) + line.legend,
          )
  
      plt.ylim((0, 1))
      plt.xlim((0, max_radius))
      plt.tick_params(labelsize=14)
      plt.xlabel("$\ell_2$ radius", fontsize=16)
      plt.ylabel("Certified Accuracy", fontsize=16)
      if "api" not in outfile:
          plt.gca().xaxis.set_major_locator(plt.MultipleLocator(0.5))
      plt.legend(loc="upper right", fontsize=16)
      plt.tight_layout()
      plt.savefig(outfile + ".pdf")
      plt.title(title, fontsize=20)
      plt.tight_layout()
      plt.savefig(outfile + ".png", dpi=300)
      plt.close()
  
imports: from easydict import EasyDict
  from typing import *
  import math
  import matplotlib
  import matplotlib.pyplot
  import numpy
  import os
  import pandas
  import seaborn
label_desc: Use image node_id 1 for calling a global function with example usage: plot_certified_accuracy_per_sigma_against_baseline(outfile, title, max_radius, methods, label, methods_base, label_base, radius_step, upper_bounds) without return types