code: def pad(total_boxes, w, h):
      # compute the padding coordinates (pad the bounding boxes to square)
      tmpw = (total_boxes[:, 2] - total_boxes[:, 0] + 1).astype(
          np.int32
      )
      tmph = (total_boxes[:, 3] - total_boxes[:, 1] + 1).astype(
          np.int32
      )
      numbox = total_boxes.shape[0]
  
      dx = np.ones((numbox), dtype=np.int32)
      dy = np.ones((numbox), dtype=np.int32)
      edx = tmpw.copy().astype(np.int32)
      edy = tmph.copy().astype(np.int32)
  
      x = total_boxes[:, 0].copy().astype(np.int32)
      y = total_boxes[:, 1].copy().astype(np.int32)
      ex = total_boxes[:, 2].copy().astype(np.int32)
      ey = total_boxes[:, 3].copy().astype(np.int32)
  
      tmp = np.where(ex > w)
      edx[tmp] = np.expand_dims(-ex[tmp] + w + tmpw[tmp], 0)
      ex[tmp] = w
  
      tmp = np.where(ey > h)
      edy[tmp] = np.expand_dims(-ey[tmp] + h + tmph[tmp], 0)
      ey[tmp] = h
  
      tmp = np.where(x < 1)
      dx[tmp] = np.expand_dims(2 - x[tmp], 0)
      x[tmp] = 1
  
      tmp = np.where(y < 1)
      dy[tmp] = np.expand_dims(2 - y[tmp], 0)
      y[tmp] = 1
  
      return dy, edy, dx, edx, y, ey, x, ex, tmpw, tmph
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
  import cv2
  import os
  import inspect
label_desc: Use image node_id 8 for calling a global function with example usage: pad(total_boxes, w, h) and returns: dy,  edy,  dx,  edx,  y,  ey,  x,  ex,  tmpw,  tmph