code: def preprocess(img):
      """Preprocess 210x160x3 uint8 frame into 6400 (80x80) 1D float vector."""
      # Crop the image.
      img = img[35:195]
      # Downsample by factor of 2.
      img = img[::2, ::2, 0]
      # Erase background (background type 1).
      img[img == 144] = 0
      # Erase background (background type 2).
      img[img == 109] = 0
      # Set everything else (paddles, ball) to 1.
      img[img != 0] = 1
      return img.astype(np.float).ravel()
  
file_path: BigDL/python/orca/example/ray_on_spark/rl_pong/rl_pong.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import argparse
  import os
  import time
  import gym
  import numpy
  import ray
  from bigdl.orca import init_orca_context, stop_orca_context
  from bigdl.orca import OrcaContext
label_desc: Use image node_id 2 for calling a global function with example usage: preprocess(img) and returns: img