code: def rotate(image, theta):
      (h, w) = image.shape[:2]
      center = (w / 2, h / 2)
      M = cv2.getRotationMatrix2D(center, theta, 1)
      rotated = cv2.warpAffine(
          image,
          M,
          (int(w), int(h)),
          cv2.INTER_LINEAR,
          borderMode=cv2.BORDER_CONSTANT,
          borderValue=(255, 255, 255),
      )
      return rotated
  
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 16 for calling a global function with example usage: rotate(image, theta) and returns: rotated