code: def entropy2(x, y):
      """Joint entropy of paired samples X and Y"""
      #
      # Bin each image into 256 gray levels
      #
      x = (stretch(x) * 255).astype(int)
      y = (stretch(y) * 255).astype(int)
      #
      # create an image where each pixel with the same X & Y gets
      # the same value
      #
      xy = 256 * x + y
      xy = xy.flatten()
      sparse = scipy.sparse.coo_matrix(
          (
              np.ones(xy.shape, dtype=np.int32),
              (xy, np.zeros(xy.shape, dtype=np.int32)),
          )
      )
      histogram = sparse.toarray()
      n = np.sum(histogram)
      if n > 0 and np.max(histogram) > 0:
          histogram = histogram[histogram > 0]
          return np.log2(n) - np.sum(histogram * np.log2(histogram)) / n
      else:
          return 0
  
imports: import numpy
  import scipy.ndimage
  import scipy.sparse
  from centrosome.filter import stretch
  from scipy.fftpack import fft2, ifft2
  from ..constants.measurement import COLTYPE_INTEGER
  from ..image import Image
  from ..module import Module
  from ..setting import Divider, SettingsGroup
  from ..setting.choice import Choice
  from ..setting.do_something import DoSomething, RemoveSettingButton
  from ..setting.subscriber import ImageSubscriber
  from ..setting.text import ImageName
label_desc: Use image node_id 4 for calling a global function with example usage: entropy2(x, y) and returns: unknown, int