class_docstr: Rotate an image randomly with padding.
  
  Args:
      max_rotation (float, optional): The maximum rotation degree. Default: 15.
      keeping_size (bool, optional): Whether or not to holding image size. Default: False.
      im_padding_value (list, optional): The padding value of raw image.
          Default: [127.5, 127.5, 127.5].
      label_padding_value (int, optional): The padding value of annotation image. Default: 255.
docstr: Args:
      im (np.ndarray): The Image data.
      label (np.ndarray, optional): The label data. Default: None.
  
  Returns:
      (tuple). When label is None, it returns (im, ), otherwise it returns (im, label).
docstr_tok: ["Args",":","im","(","np.ndarray",")",":","The","Image","data",".","label","(","np.ndarray",",","optional",")",":","The","label","data",".","Default",":","None",".","Returns",":","(","tuple",")",".","When","label","is","None",",","it","returns","(","im",",",")",",","otherwise","it","returns","(","im",",","label",")","."]
code: def __call__(self, im, label=None):
      """
      Args:
          im (np.ndarray): The Image data.
          label (np.ndarray, optional): The label data. Default: None.
  
      Returns:
          (tuple). When label is None, it returns (im, ), otherwise it returns (im, label).
      """
  
      if self.max_rotation > 0:
          (h, w) = im.shape[:2]
          do_rotation = np.random.uniform(
              -self.max_rotation, self.max_rotation
          )
          pc = (w // 2, h // 2)
          r = cv2.getRotationMatrix2D(pc, do_rotation, 1.0)
          if self.keeping_size:
              dsize = (w, h)
          else:
              cos = np.abs(r[0, 0])
              sin = np.abs(r[0, 1])
  
              nw = int((h * sin) + (w * cos))
              nh = int((h * cos) + (w * sin))
              (cx, cy) = pc
              r[0, 2] += (nw / 2) - cx
              r[1, 2] += (nh / 2) - cy
              dsize = (nw, nh)
          im = cv2.warpAffine(
              im,
              r,
              dsize=dsize,
              flags=cv2.INTER_LINEAR,
              borderMode=cv2.BORDER_CONSTANT,
              borderValue=self.im_padding_value,
          )
          if label is not None:
              label = cv2.warpAffine(
                  label,
                  r,
                  dsize=dsize,
                  flags=cv2.INTER_NEAREST,
                  borderMode=cv2.BORDER_CONSTANT,
                  borderValue=self.label_padding_value,
              )
  
      if label is None:
          return (im,)
      else:
          return (im, label)
  
file_path: PaddleSeg/contrib/LaneSeg/transforms/lane_transforms.py
imports: import cv2
  import numpy
  from paddleseg.cvlibs import manager
label_desc: Use image node_id 2 for calling the LaneRandomRotation obj's underlying member method code with example usage: obj.__call__(im, label) and returns: im, im,  label