code: def random_rotate(images, max_angle):
      angle = random.random() * 2 * max_angle - max_angle
      for i in range(len(images)):
          img = images[i]
          w, h = img.shape[:2]
          rotation_matrix = cv2.getRotationMatrix2D(
              (h / 2, w / 2), angle, 1
          )
          if i == len(images) - 1:
              img_rotation = cv2.warpAffine(
                  img,
                  M=rotation_matrix,
                  dsize=(h, w),
                  flags=cv2.INTER_NEAREST,
              )
          else:
              img_rotation = cv2.warpAffine(
                  img, rotation_matrix, (h, w)
              )
          images[i] = img_rotation
      return images
  
file_path: EasyOCR/trainer/craft/data/imgaug.py
imports: import random
  import cv2
  import numpy
  from PIL import Image
  from torchvision.transforms.functional import resized_crop, crop
  from torchvision.transforms import RandomResizedCrop, RandomCrop
  from torchvision.transforms import InterpolationMode
label_desc: Use image node_id 7 for calling a global function with example usage: random_rotate(images, max_angle) and returns: images