code: def _get_affine_matrix(
      center, angle, translate, scale, shear
  ) -> Tensor:
      # Helper method to compute matrix for affine transformation
      # We need compute affine transformation matrix: M = T * C * RSS * C^-1
      # where T is translation matrix: [1, 0, tx | 0, 1, ty | 0, 0, 1]
      #       C is translation matrix to keep center: [1, 0, cx | 0, 1, cy | 0, 0, 1]
      #       RSS is rotation with scale and shear matrix
      #       RSS(a, scale, shear) = [ cos(a)*scale    -sin(a + shear)*scale     0]
      #                              [ sin(a)*scale    cos(a + shear)*scale     0]
      #                              [     0                  0          1]
  
      angle = math.radians(angle)
      shear = math.radians(shear)
      # scale = 1.0 / scale
  
      T = np.array(
          [[1, 0, translate[0]], [0, 1, translate[1]], [0, 0, 1]]
      )
      C = np.array([[1, 0, center[0]], [0, 1, center[1]], [0, 0, 1]])
      RSS = np.array(
          [
              [
                  math.cos(angle) * scale,
                  -math.sin(angle + shear) * scale,
                  0,
              ],
              [
                  math.sin(angle) * scale,
                  math.cos(angle + shear) * scale,
                  0,
              ],
              [0, 0, 1],
          ]
      )
      matrix = T @ C @ RSS @ np.linalg.inv(C)
  
      return matrix[:2, :]
  
file_path: caer/caer/transforms/color.py
imports: import numpy
  import random
  import cv2
  import math
  from ..coreten import Tensor, to_tensor
  from ..annotations import Union, List, Tuple
  from .functional import is_list, _hls, _exposure_process
label_desc: Use image node_id 9 for calling a global function with example usage: _get_affine_matrix(center, angle, translate, scale, shear) and returns: matrix