code: def __midpoint_numeric_integral__(x, y):
      """
      Compute numeric integral using the midpoint rule.
  
      :param x: The x coordinate of the curve
      :type x: list or numpy array
      :param y: The y coordinate of the curve
      :type y: list or numpy array
      :return: numeric integral value as float
      """
      if not isinstance(y, numpy.ndarray):
          y = numpy.array(y)
      dx = numpy.diff(x)
      y_midpoints = 0.5 * (y[:-1] + y[1:])
      area = numpy.sum(dx * y_midpoints)
      return abs(area)
  
imports: from __future__ import division
  from .pycm_error import pycmCurveError, pycmPlotError
  from .pycm_util import threshold_func, thresholds_calc, isfloat
  from .pycm_param import *
  from .pycm_obj import ConfusionMatrix
  from warnings import warn
  import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: __midpoint_numeric_integral__(x, y) and returns: abs