docstr: Randomly rotate images and polygon masks.
  
  Args:
      rotate_ratio (float): The ratio of samples to operate rotation.
      max_angle (int): The maximum rotation angle.
      pad_with_fixed_color (bool): The flag for whether to pad rotated
         image with fixed value. If set to False, the rotated image will
         be padded onto cropped image.
      pad_value (tuple(int)): The color value for padding rotated image.
docstr_tok: ["Randomly","rotate","images","and","polygon","masks",".","Args",":","rotate_ratio","(","float",")",":","The","ratio","of","samples","to","operate","rotation",".","max_angle","(","int",")",":","The","maximum","rotation","angle",".","pad_with_fixed_color","(","bool",")",":","The","flag","for","whether","to","pad","rotated","image","with","fixed","value",".","If","set","to","False",",","the","rotated","image","will","be","padded","onto","cropped","image",".","pad_value","(","tuple","(","int",")",")",":","The","color","value","for","padding","rotated","image","."]
code: def __init__(
      self,
      rotate_ratio=0.5,
      max_angle=10,
      pad_with_fixed_color=False,
      pad_value=(0, 0, 0),
      **kwargs,
  ):
      """Randomly rotate images and polygon masks.
  
      Args:
          rotate_ratio (float): The ratio of samples to operate rotation.
          max_angle (int): The maximum rotation angle.
          pad_with_fixed_color (bool): The flag for whether to pad rotated
             image with fixed value. If set to False, the rotated image will
             be padded onto cropped image.
          pad_value (tuple(int)): The color value for padding rotated image.
      """
      self.rotate_ratio = rotate_ratio
      self.max_angle = max_angle
      self.pad_with_fixed_color = pad_with_fixed_color
      self.pad_value = pad_value
  
imports: import numpy
  from PIL import Image, ImageDraw
  import cv2
  from shapely.geometry import Polygon
  import math
  from ppocr.utils.poly_nms import poly_intersection
label_desc: Use image node_id 1 to create a new RandomRotatePolyInstances object  with example: obj = RandomRotatePolyInstances(rotate_ratio, max_angle, pad_with_fixed_color, pad_value)