code: def posterize(arr, n_bits):
      import numpy as np
      import PIL.Image
      import PIL.ImageOps
  
      img = PIL.Image.fromarray(arr)
      img_q = PIL.ImageOps.posterize(img, n_bits)
      return np.asarray(img_q)
  
imports: from __future__ import print_function, division, absolute_import
  import imgaug.augmenters
  import imgaug
  import timeit
label_desc: Use image node_id 2 for calling a global function with example usage: posterize(arr, n_bits) and returns: np