code: def keypoint_safe_rotate(
      keypoint: KeypointInternalType,
      matrix: np.ndarray,
      angle: float,
      scale_x: float,
      scale_y: float,
      cols: int,
      rows: int,
  ) -> KeypointInternalType:
      x, y, a, s = keypoint[:4]
      point = np.array([[x, y, 1]])
      x, y = (point @ matrix.T)[0]
  
      # To avoid problems with float errors
      x = np.clip(x, 0, cols - 1)
      y = np.clip(y, 0, rows - 1)
  
      a += angle
      s *= max(scale_x, scale_y)
      return x, y, a, s
  
imports: import math
  from typing import List, Optional, Sequence, Tuple, Union
  import cv2
  import numpy
  import skimage.transform
  from scipy.ndimage import gaussian_filter
  from albumentations.augmentations.utils import _maybe_process_in_chunks, angle_2pi_range, clipped, preserve_channel_dim, preserve_shape
  from ...None import random_utils
  from ...core.bbox_utils import denormalize_bbox, normalize_bbox
  from ...core.transforms_interface import BoxInternalType, FillValueType, ImageColorType, KeypointInternalType
label_desc: Use image node_id 27 for calling a global function with example usage: keypoint_safe_rotate(keypoint, matrix, angle, scale_x, scale_y, cols, rows) and returns: x,  y,  a,  s