code: def iou(boxA, boxB):
      # determine the (x, y)-coordinates of the intersection rectangle
      xA = max(boxA[0], boxB[0])
      yA = max(boxA[1], boxB[1])
      xB = min(boxA[2], boxB[2])
      yB = min(boxA[3], boxB[3])
  
      interArea = max(0, xB - xA) * max(0, yB - yA)
      if interArea < 1e-7:
          return 0
  
      boxAArea = (boxA[2] - boxA[0]) * (boxA[3] - boxA[1])
      boxBArea = (boxB[2] - boxB[0]) * (boxB[3] - boxB[1])
      if boxAArea + boxBArea - interArea < 1e-7:
          return 0
  
      iou_val = interArea / float(boxAArea + boxBArea - interArea)
      return iou_val
  
imports: import logging
  import time
  from operator import attrgetter, itemgetter
  import dgl
  import mxnet
  import numpy
  from dgl.nn.mxnet import GraphConv
  from dgl.utils import toindex
  from gluoncv.data.batchify import Pad
  from gluoncv.model_zoo import get_model
  from mxnet import gluon, nd
  from mxnet.gluon import nn
label_desc: Use image node_id 1 for calling a global function with example usage: iou(boxA, boxB) and returns: iou_val, int, int