code: def calculate_bb_overlap(rp, gt):
      """
      Returns a matrix of overlaps between every possible pair of the two provided
      bounding box lists.
  
      Arguments:
          rp (list): an array of region proposals, shape (R, 4)
          gt (list): an array of ground truth ROIs, shape (G, 4)
  
      Outputs:
          overlaps: a matrix of overlaps between 2 list, shape (R, G)
      """
      R = rp.shape[0]
      G = gt.shape[0]
      overlaps = np.zeros((R, G), dtype=np.float32)
  
      for g in range(G):
          gt_box_area = float(
              (gt[g, 2] - gt[g, 0] + 1) * (gt[g, 3] - gt[g, 1] + 1)
          )
          for r in range(R):
              iw = float(
                  min(rp[r, 2], gt[g, 2]) - max(rp[r, 0], gt[g, 0]) + 1
              )
              if iw > 0:
                  ih = float(
                      min(rp[r, 3], gt[g, 3])
                      - max(rp[r, 1], gt[g, 1])
                      + 1
                  )
                  if ih > 0:
                      ua = float(
                          (rp[r, 2] - rp[r, 0] + 1)
                          * (rp[r, 3] - rp[r, 1] + 1)
                          + gt_box_area
                          - iw * ih
                      )
                      overlaps[r, g] = iw * ih / ua
      return overlaps
  
imports: from __future__ import division
  from __future__ import print_function
  from builtins import zip
  import numpy
  import os
  from neon.util.persist import load_obj
  from neon.data.datasets import Dataset
  from neon.initializers import Constant, Xavier
  from neon.transforms import Rectlin
  from neon.layers import Conv, Pooling
label_desc: Use image node_id 11 for calling a global function with example usage: calculate_bb_overlap(rp, gt) and returns: overlaps