code: def save_image(img, filepath):
      """Save an image to filepath.
  
      It assumes `img` is a float numpy array with value in [0, 1]
  
      Args:
        img: a float numpy array with value in [0, 1] representing the image.
        filepath: a string of file path.
      """
      img = np.maximum(0, np.minimum(1, img))
      im = Image.fromarray(np.uint8(img * 255))
      im.save(filepath)
  
imports: import functools
  import importlib
  import os
  from magenta.models.latent_transfer import local_mnist
  import numpy
  from PIL import Image
  import tensorflow.compat.v1
label_desc: Use image node_id 9 for calling a global function with example usage: save_image(img, filepath) without return types