code: def save_plot(figure: plt.Figure, path: Text, outformat="png"):
      """Store a figure to disk."""
      if path is not None:
          with open(path, "wb") as f:
              figure.savefig(f, bbox_inches="tight", format=outformat)
          plt.close(figure)
  
imports: from typing import Text, Iterable, Optional
  import matplotlib.pyplot
  import numpy
  from sklearn import metrics
label_desc: Use image node_id 1 for calling a global function with example usage: save_plot(figure, path, outformat) without return types