docstr: :param degrees: 角度，可以是一个数值或者list
  :param ramdon_rate: 随机系数
  :param same_size: 是否保持和原图一样大
  :return:
docstr_tok: [":","param","degrees",":","\u89d2\u5ea6\uff0c\u53ef\u4ee5\u662f\u4e00\u4e2a\u6570\u503c\u6216\u8005list",":","param","ramdon_rate",":","\u968f\u673a\u7cfb\u6570",":","param","same_size",":","\u662f\u5426\u4fdd\u6301\u548c\u539f\u56fe\u4e00\u6837\u5927",":","return",":"]
code: def __init__(self, degrees, random_rate, same_size=False):
      """
      :param degrees: 角度，可以是一个数值或者list
      :param ramdon_rate: 随机系数
      :param same_size: 是否保持和原图一样大
      :return:
      """
      if isinstance(degrees, numbers.Number):
          if degrees < 0:
              raise ValueError(
                  "If degrees is a single number, it must be positive."
              )
          degrees = (-degrees, degrees)
      elif (
          isinstance(degrees, list)
          or isinstance(degrees, tuple)
          or isinstance(degrees, np.ndarray)
      ):
          if len(degrees) != 2:
              raise ValueError(
                  "If degrees is a sequence, it must be of len 2."
              )
          degrees = degrees
      else:
          raise Exception(
              "degrees must in Number or list or tuple or np.ndarray"
          )
      self.degrees = degrees
      self.same_size = same_size
      self.random_rate = random_rate
  
imports: import math
  import numbers
  import random
  import cv2
  import numpy
  from skimage.util import random_noise
label_desc: Use image node_id 1 to create a new RandomRotateImgBox object  with example: obj = RandomRotateImgBox(degrees, random_rate, same_size)