code: def crop_and_pad_keypoint(
      keypoint: KeypointInternalType,
      crop_params: Optional[Sequence[int]],
      pad_params: Optional[Sequence[int]],
      rows: int,
      cols: int,
      result_rows: int,
      result_cols: int,
      keep_size: bool,
  ) -> KeypointInternalType:
      x, y, angle, scale = keypoint[:4]
  
      if crop_params is not None:
          crop_x1, crop_y1, crop_x2, crop_y2 = crop_params
          x, y = x - crop_x1, y - crop_y1
      if pad_params is not None:
          top, bottom, left, right = pad_params
          x, y = x + left, y + top
  
      if keep_size and (result_cols != cols or result_rows != rows):
          scale_x = cols / result_cols
          scale_y = rows / result_rows
          return FGeometric.keypoint_scale(
              (x, y, angle, scale), scale_x, scale_y
          )
  
      return x, y, angle, scale
  
imports: from typing import Optional, Sequence, Tuple
  import cv2
  import numpy
  from albumentations.augmentations.utils import _maybe_process_in_chunks, preserve_channel_dim
  from ...core.bbox_utils import denormalize_bbox, normalize_bbox
  from ...core.transforms_interface import BoxInternalType, KeypointInternalType
  from ..geometric import functional
label_desc: Use image node_id 16 for calling a global function with example usage: crop_and_pad_keypoint(keypoint, crop_params, pad_params, rows, cols, result_rows, result_cols, keep_size) and returns: x,  y,  angle,  scale, FGeometric