code: def arr2img(arr):
      # arr is expected to be a 2d array of floats in [0,1]
      return Image.frombuffer(
          "L",
          arr.shape,
          (arr * 255).astype(np.uint8).tostring(),
          "raw",
          "L",
          0,
          1,
      )
  
file_path: pyro/examples/air/viz.py
imports: import math
  from collections import namedtuple
  import numpy
  from PIL import Image, ImageDraw
label_desc: Use image node_id 2 for calling a global function with example usage: arr2img(arr) and returns: Image