code: def crop_image(im, rect, scale):
      xmin, ymin, xmax, ymax = rect
      crop = [xmin, ymin, xmax, ymax]
      xmin, ymin, xmax, ymax = [int(x / scale) for x in crop]
      cropped = im[ymin:ymax, xmin:xmax]
      return cropped
  
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 9 for calling a global function with example usage: crop_image(im, rect, scale) and returns: cropped