code: def bounding_box_iou(box_A_input, box_B_input):
      # The inputs are array-likes in the form
      # [x_0, y_0, delta_x,delta_y]
      # where the deltas are positive
  
      box_A = np.array(box_A_input)
      box_B = np.array(box_B_input)
  
      if box_A[2] < 0:
          raise ValueError("Bad delta_x for box_A")
      if box_A[3] < 0:
          raise ValueError("Bad delta y for box_A")
      if box_B[2] < 0:
          raise ValueError("Bad delta x for box_B")
      if box_B[3] < 0:
          raise ValueError("Bad delta y for box_B")
  
      # Convert deltas to coordinates
      box_A[2:4] = box_A[0:2] + box_A[2:4]
      box_B[2:4] = box_B[0:2] + box_B[2:4]
  
      # Determine the (x, y)-coordinates of the intersection rectangle
      x_A = max(box_A[0], box_B[0])
      y_A = max(box_A[1], box_B[1])
      x_B = min(box_A[2], box_B[2])
      y_B = min(box_A[3], box_B[3])
  
      if (x_B < x_A) or (y_B < y_A):
          return 0
  
      # Compute the area of intersection rectangle
      interArea = (x_B - x_A) * (y_B - y_A)
  
      # Compute the area of both the prediction and ground-truth
      # rectangles
      box_A_area = (box_A[2] - box_A[0]) * (box_A[3] - box_A[1])
      box_B_area = (box_B[2] - box_B[0]) * (box_B[3] - box_B[1])
  
      # Compute the intersection over union by taking the intersection
      # area and dividing it by the sum of prediction + ground-truth
      # areas - the intersection area
      iou = interArea / float(box_A_area + box_B_area - interArea)
  
      return iou
  
imports: import functools
  import numpy
  import sklearn.metrics
  from fairlearn.metrics import MetricFrame
label_desc: Use image node_id 1 for calling a global function with example usage: bounding_box_iou(box_A_input, box_B_input) and returns: iou, int