code: def plot_comparison(
      figures_dir, simple_ind, conf_ind, simple_dep, conf_dep
  ):
      """Plots variants of GNMax algorithm and their analyses."""
  
      def pivot(x_axis, eps, answered):
          y = np.full(len(x_axis), None, dtype=float)  # delta
          for i, x in enumerate(x_axis):
              idx = np.searchsorted(answered, x)
              if idx < len(eps):
                  y[i] = eps[idx]
          return y
  
      def pivot_dep(x_axis, data_dep):
          eps_partitioned, answered, _, _ = data_dep
          eps = [sum(p) for p in eps_partitioned]  # Flatten eps
          return pivot(x_axis, eps, answered)
  
      xlim = 10000
      x_axis = range(0, xlim, 10)
  
      y_simple_ind = pivot(x_axis, *simple_ind)
      y_conf_ind = pivot(x_axis, *conf_ind)
  
      y_simple_dep = pivot_dep(x_axis, simple_dep)
      y_conf_dep = pivot_dep(x_axis, conf_dep)
  
      # plt.close('all')
      fig, ax = plt.subplots()
      fig.set_figheight(4.5)
      fig.set_figwidth(4.7)
  
      ax.plot(
          x_axis,
          y_simple_ind,
          ls="--",
          color="r",
          lw=3,
          label=r"Simple GNMax, data-ind analysis",
      )
      ax.plot(
          x_axis,
          y_conf_ind,
          ls="--",
          color="b",
          lw=3,
          label=r"Confident GNMax, data-ind analysis",
      )
      ax.plot(
          x_axis,
          y_simple_dep,
          ls="-",
          color="r",
          lw=3,
          label=r"Simple GNMax, data-dep analysis",
      )
      ax.plot(
          x_axis,
          y_conf_dep,
          ls="-",
          color="b",
          lw=3,
          label=r"Confident GNMax, data-dep analysis",
      )
  
      plt.xticks(np.arange(0, xlim + 1000, 2000))
      plt.xlim([0, xlim])
      plt.ylim(bottom=0)
      plt.legend(fontsize=16)
      ax.set_xlabel("Number of queries answered", fontsize=16)
      ax.set_ylabel(
          r"Privacy cost $\varepsilon$ at $\delta=10^{-8}$", fontsize=16
      )
  
      ax.tick_params(labelsize=14)
      plot_filename = os.path.join(figures_dir, "comparison.pdf")
      print("Saving the graph to " + plot_filename)
      fig.savefig(plot_filename, bbox_inches="tight")
      plt.show()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import os
  import pickle
  import sys
  from absl import app
  from absl import flags
  from collections import namedtuple
  import matplotlib
  import matplotlib.pyplot
  import numpy
  import core
  import smooth_sensitivity
label_desc: Use image node_id 3 for calling a global function with example usage: plot_comparison(figures_dir, simple_ind, conf_ind, simple_dep, conf_dep) and returns: y, pivot