code: def write_image_file(image, output_path):
      """
      Write image (NDArray) to file
      :param image: NDArrary
      :param output_path: String
      :return:
      """
      # The only problem of output result is that
      # image path is lost after converting to ND array.
      # So, we set current filename as timestamp with first 10 number.
      write_path = (
          output_path
          + "/"
          + datetime.now().strftime("%Y%m%d-%H%M%S")
          + "-"
          + "".join([str(int(i * 100)) for i in image[:8, 0, 0]])
      )
      print("Writing image to " + write_path)
      cv2.imwrite(write_path + ".jpg", image)
  
file_path: analytics-zoo/pyzoo/zoo/examples/streaming/objectdetection/streaming_object_detection.py
imports: import argparse
  import cv2
  from pyspark.streaming import StreamingContext
  from PIL import Image
  from datetime import datetime
  from zoo.common.nncontext import *
  from zoo.models.image.objectdetection import *
label_desc: Use image node_id 2 for calling a global function with example usage: write_image_file(image, output_path) without return types