code: def convert_rgb_to_bokehrgba(img_data, downsample=1):
      """
      Convert RGB image to two-dimensional array of RGBA values (encoded as 32-bit integers)
      (required by Bokeh). The functionality is currently not available in Bokeh.
      An issue was raised here: https://github.com/bokeh/bokeh/issues/1699 and this function is a
      modified version of the suggested solution.
  
      Arguments:
          img_data: img (ndarray, shape: [N, M, 3], dtype: uint8): image data
          dh: height of image
          dw: width of image
  
      Returns:
          img (ndarray): 2D image array of RGBA values
      """
      if img_data.dtype != np.uint8:
          raise NotImplementedError
  
      if img_data.ndim != 3:
          raise NotImplementedError
  
      # downsample for render performance, v-flip since plot origin is bottom left
      # img_data = np.transpose(img_data, (1,2,0))
      img_data = img_data[::-downsample, ::downsample, :]
      img_h, img_w, C = img_data.shape
  
      # add an alpha channel to the image and recast from pixels of u8u8u8u8 to u32
      bokeh_img = np.dstack(
          [img_data, 255 * np.ones((img_h, img_w), np.uint8)]
      )
      final_image = bokeh_img.reshape(img_h, img_w * (C + 1)).view(
          np.uint32
      )
  
      return final_image
  
file_path: neon/neon/visualizations/data.py
imports: from __future__ import division
  from builtins import str
  import h5py
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: convert_rgb_to_bokehrgba(img_data, downsample) and returns: final_image