code: def rects_are_vertical(rect1, rect2):
      xmin1, ymin1, xmax1, ymax1 = rect1
      xmin2, ymin2, xmax2, ymax2 = rect2
  
      midpoint1 = (xmin1 + xmax1) / 2
      midpoint2 = (xmin2 + xmax2) / 2
      dist = abs(midpoint1 - midpoint2)
  
      rectarea1 = rect_area(rect1)
      rectarea2 = rect_area(rect2)
      if rectarea1 > rectarea2:
          thres = (xmax1 - xmin1) * 0.1
      else:
          thres = (xmax2 - xmin2) * 0.1
      if thres > dist:
          align = True
      else:
          align = False
      return align
  
imports: import os
  import traceback
  import sys
  import cv2
  import numpy
  from PIL import Image
  from scipy.ndimage.filters import rank_filter
  import pytesseract
label_desc: Use image node_id 12 for calling a global function with example usage: rects_are_vertical(rect1, rect2) and returns: align