code: def Cminus(x, y, xmax, ymax):
      """Lynden-Bell's C-minus method
  
      Parameters
      ----------
      x : array_like
          array of x values
      y : array_like
          array of y values
      xmax : array_like
          array of maximum x values for each y value
      ymax : array_like
          array of maximum y values for each x value
  
      Returns
      -------
      Nx, Ny, cuml_x, cuml_y: ndarrays
          Nx and cuml_x are in the order of the sorted x array
          Ny and cuml_y are in the order of the sorted y array
      """
      # make copies of input
      x, y, xmax, ymax = map(np.array, (x, y, xmax, ymax))
  
      Nall = len(x)
  
      cuml_x = np.zeros(x.shape)
      cuml_y = np.zeros(y.shape)
      Nx = np.zeros(x.shape)
      Ny = np.zeros(y.shape)
  
      # first the y direction.
      i_sort = np.argsort(y)
      x = x[i_sort]
      y = y[i_sort]
      xmax = xmax[i_sort]
      ymax = ymax[i_sort]
  
      for j in range(1, Nall):
          # Making sure we don't divide with 0 later
          objects = np.sum(x[:j] < xmax[j])
          if objects:
              Ny[j] = objects
          else:
              Ny[j] = np.inf
  
      Ny[0] = np.inf
      cuml_y = np.cumprod(1.0 + 1.0 / Ny)
  
      Ny[np.isinf(Ny)] = 0
  
      # renormalize
      cuml_y *= Nall / cuml_y[-1]
  
      # now the x direction
      i_sort = np.argsort(x)
      x = x[i_sort]
      y = y[i_sort]
      xmax = xmax[i_sort]
      ymax = ymax[i_sort]
  
      for i in range(1, Nall):
          # Making sure we don't divide with 0 later
          objects = np.sum(y[:i] < ymax[i])
          if objects:
              Nx[i] = objects
          else:
              Nx[i] = np.inf
  
      Nx[0] = np.inf
      cuml_x = np.cumprod(1.0 + 1.0 / Nx)
  
      Nx[np.isinf(Nx)] = 0
  
      # renormalize
      cuml_x *= Nall / cuml_x[-1]
  
      return Nx, Ny, cuml_x, cuml_y
  
imports: import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: Cminus(x, y, xmax, ymax) and returns: Nx,  Ny,  cuml_x,  cuml_y