code: def keypoint_piecewise_affine(
      keypoint: KeypointInternalType,
      matrix: Optional[skimage.transform.PiecewiseAffineTransform],
      h: int,
      w: int,
      keypoints_threshold: float,
  ) -> KeypointInternalType:
      if matrix is None:
          return keypoint
      x, y, a, s = keypoint[:4]
      dist_maps = to_distance_maps([(x, y)], h, w, True)
      dist_maps = piecewise_affine(dist_maps, matrix, 0, "constant", 0)
      x, y = from_distance_maps(
          dist_maps, True, {"x": -1, "y": -1}, keypoints_threshold
      )[0]
      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 31 for calling a global function with example usage: keypoint_piecewise_affine(keypoint, matrix, h, w, keypoints_threshold) and returns: x,  y,  a,  s, keypoint