code: def _calc_texture_gradient(img):
      """
      calculate texture gradient for entire image
  
      The original SelectiveSearch algorithm proposed Gaussian derivative
      for 8 orientations, but we use LBP instead.
  
      output will be [height(*)][width(*)]
      """
      ret = numpy.zeros((img.shape[0], img.shape[1], img.shape[2]))
  
      for colour_channel in (0, 1, 2):
          ret[
              :, :, colour_channel
          ] = skimage.feature.local_binary_pattern(
              img[:, :, colour_channel], 8, 1.0
          )
  
      return ret
  
imports: import sys
  from past.builtins import cmp
  import skimage.io
  import skimage.feature
  import skimage.color
  import skimage.transform
  import skimage.util
  import skimage.segmentation
  import numpy
label_desc: Use image node_id 8 for calling a global function with example usage: _calc_texture_gradient(img) and returns: ret