code: def to_distance_maps(
      keypoints: Sequence[Tuple[float, float]],
      height: int,
      width: int,
      inverted: bool = False,
  ) -> np.ndarray:
      """Generate a ``(H,W,N)`` array of distance maps for ``N`` keypoints.
  
      The ``n``-th distance map contains at every location ``(y, x)`` the
      euclidean distance to the ``n``-th keypoint.
  
      This function can be used as a helper when augmenting keypoints with a
      method that only supports the augmentation of images.
  
      Args:
          keypoint: keypoint coordinates
          height: image height
          width: image width
          inverted (bool): If ``True``, inverted distance maps are returned where each
              distance value d is replaced by ``d/(d+1)``, i.e. the distance
              maps have values in the range ``(0.0, 1.0]`` with ``1.0`` denoting
              exactly the position of the respective keypoint.
  
      Returns:
          (H, W, N) ndarray
              A ``float32`` array containing ``N`` distance maps for ``N``
              keypoints. Each location ``(y, x, n)`` in the array denotes the
              euclidean distance at ``(y, x)`` to the ``n``-th keypoint.
              If `inverted` is ``True``, the distance ``d`` is replaced
              by ``d/(d+1)``. The height and width of the array match the
              height and width in ``KeypointsOnImage.shape``.
      """
      distance_maps = np.zeros(
          (height, width, len(keypoints)), dtype=np.float32
      )
  
      yy = np.arange(0, height)
      xx = np.arange(0, width)
      grid_xx, grid_yy = np.meshgrid(xx, yy)
  
      for i, (x, y) in enumerate(keypoints):
          distance_maps[:, :, i] = (grid_xx - x) ** 2 + (
              grid_yy - y
          ) ** 2
  
      distance_maps = np.sqrt(distance_maps)
      if inverted:
          return 1 / (distance_maps + 1)
      return distance_maps
  
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 29 for calling a global function with example usage: to_distance_maps(keypoints, height, width, inverted) and returns: distance_maps, unknown