code: def _get_inverse_affine_matrix(
      self, center, angle, translate, scale, shear
  ):
      # https://github.com/pytorch/vision/blob/v0.4.0/torchvision/transforms/functional.py#L717
      from numpy import sin, cos, tan
  
      if isinstance(shear, numbers.Number):
          shear = [shear, 0]
  
      if not isinstance(shear, (tuple, list)) and len(shear) == 2:
          raise ValueError(
              "Shear should be a single value or a tuple/list containing "
              + "two values. Got {}".format(shear)
          )
  
      rot = math.radians(angle)
      sx, sy = [math.radians(s) for s in shear]
  
      cx, cy = center
      tx, ty = translate
  
      # RSS without scaling
      a = cos(rot - sy) / cos(sy)
      b = -cos(rot - sy) * tan(sx) / cos(sy) - sin(rot)
      c = sin(rot - sy) / cos(sy)
      d = -sin(rot - sy) * tan(sx) / cos(sy) + cos(rot)
  
      # Inverted rotation matrix with scale and shear
      # det([[a, b], [c, d]]) == 1, since det(rotation) = 1 and det(shear) = 1
      M = [d, -b, 0, -c, a, 0]
      M = [x / scale for x in M]
  
      # Apply inverse of translation and of center translation: RSS^-1 * C^-1 * T^-1
      M[2] += M[0] * (-cx - tx) + M[1] * (-cy - ty)
      M[5] += M[3] * (-cx - tx) + M[4] * (-cy - ty)
  
      # Apply center translation: C * RSS^-1 * C^-1 * T^-1
      M[2] += cx
      M[5] += cy
      return M
  
imports: import math
  import numbers
  import random
  import cv2
  import numpy
  from paddle.vision.transforms import Compose, ColorJitter
label_desc: Use image node_id 2 for calling the CVRandomAffine obj's underlying member method code with example usage: obj._get_inverse_affine_matrix(center, angle, translate, scale, shear) and returns: M