code: def save_to_image(img, filename):
      """Save a shaded image as PNG file.
  
      Parameters
      ----------
      img: xarray
        The image to save
      filename: unicode
        The name of the file to save to, 'png' extension will be appended.
  
      """
      filename = os.path.join(datadir, filename + ".png")
      print("Saving: " + filename)
      img.to_pil().save(filename)
  
imports: import os
  import xarray
  import datashader
  import pandas
  import numpy
  import pytest
label_desc: Use image node_id 5 for calling a global function with example usage: save_to_image(img, filename) without return types