code: def __init__(self, rotate, padding, ignore_label=255, p=0.5):
      assert (
          isinstance(rotate, collections.Iterable) and len(rotate) == 2
      )
      if (
          isinstance(rotate[0], numbers.Number)
          and isinstance(rotate[1], numbers.Number)
          and rotate[0] < rotate[1]
      ):
          self.rotate = rotate
      else:
          raise (
              RuntimeError(
                  "segtransform.RandRotate() scale param error.\n"
              )
          )
      assert padding is not None
      assert isinstance(padding, list) and len(padding) == 3
      if all(isinstance(i, numbers.Number) for i in padding):
          self.padding = padding
      else:
          raise (
              RuntimeError(
                  "padding in RandRotate() should be a number list\n"
              )
          )
      assert isinstance(ignore_label, int)
      self.ignore_label = ignore_label
      self.p = p
  
imports: import random
  import math
  import numpy
  import numbers
  import collections
  import cv2
  import torch
  import time
label_desc: Use image node_id 1 to create a new RandRotate object from inherited base classes: object with example: obj = RandRotate(rotate, padding, ignore_label, p)