code: def keypoints_draw_on_image(
      kps,
      image,
      color=[0, 255, 0],
      size=3,
      copy=True,
      raise_if_out_of_image=False,
      border=50,
  ):
      if copy:
          image = np.copy(image)
  
      image = np.pad(
          image,
          ((border, border), (border, border), (0, 0)),
          mode="constant",
          constant_values=0,
      )
  
      height, width = image.shape[0:2]
  
      for keypoint in kps.keypoints:
          y, x = keypoint.y + border, keypoint.x + border
          if 0 <= y < height and 0 <= x < width:
              x1 = max(x - size // 2, 0)
              x2 = min(x + 1 + size // 2, width - 1)
              y1 = max(y - size // 2, 0)
              y2 = min(y + 1 + size // 2, height - 1)
              image[y1:y2, x1:x2] = color
          else:
              if raise_if_out_of_image:
                  raise Exception(
                      "Cannot draw keypoint x=%d, y=%d on image with shape %s."
                      % (y, x, image.shape)
                  )
  
      return image
  
imports: from __future__ import print_function, division
  import numpy
  import imgaug
  import imgaug.random
  from imgaug import augmenters
label_desc: Use image node_id 2 for calling a global function with example usage: keypoints_draw_on_image(kps, image, color, size, copy, raise_if_out_of_image, border) and returns: image