code: def save_image(figure, filename):
      
      path = os.path.join(IMAGES_DIR, filename)
      figure.savefig(path, bbox_inches="tight")
      plt.close(figure)
docs: Save an image to the docs images directory.
  
      Args:
          filename (str): The name of the file (not containing
              directory info).