code: def _continuous_to_discrete_coords(bounds, level, total_bounds):
      """
      Calculates mid points & ranges of geoms and returns
      as discrete coords
  
      Parameters
      ----------
  
      bounds : Bounds of each geometry - array
  
      p : The number of iterations used in constructing the Hilbert curve
  
      total_bounds : Total bounds of geometries - array
  
      Returns
      -------
      Discrete two-dimensional numpy array
      Two-dimensional array Array of hilbert distances for each geom
  
      """
      # Hilbert Side length
      side_length = (2**level) - 1
  
      # Calculate mid points for x and y bound coords - returns array
      x_mids = (bounds[:, 0] + bounds[:, 2]) / 2.0
      y_mids = (bounds[:, 1] + bounds[:, 3]) / 2.0
  
      # Calculate x and y range of total bound coords - returns array
      if total_bounds is None:
          total_bounds = (
              np.nanmin(x_mids),
              np.nanmin(y_mids),
              np.nanmax(x_mids),
              np.nanmax(y_mids),
          )
  
      xmin, ymin, xmax, ymax = total_bounds
  
      # Transform continuous value to discrete integer for each dimension
      x_int = _continuous_to_discrete(x_mids, (xmin, xmax), side_length)
      y_int = _continuous_to_discrete(y_mids, (ymin, ymax), side_length)
  
      return x_int, y_int
  
imports: import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: _continuous_to_discrete_coords(bounds, level, total_bounds) and returns: x_int,  y_int