code: def test_draw_keypoints_errors():
      h, w = 10, 10
      img = torch.full((3, 100, 100), 0, dtype=torch.uint8)
  
      with pytest.raises(TypeError, match="The image must be a tensor"):
          utils.draw_keypoints(
              image="Not A Tensor Image", keypoints=keypoints
          )
      with pytest.raises(ValueError, match="The image dtype must be"):
          img_bad_dtype = torch.full((3, h, w), 0, dtype=torch.int64)
          utils.draw_keypoints(image=img_bad_dtype, keypoints=keypoints)
      with pytest.raises(
          ValueError, match="Pass individual images, not batches"
      ):
          batch = torch.randint(
              0, 256, size=(10, 3, h, w), dtype=torch.uint8
          )
          utils.draw_keypoints(image=batch, keypoints=keypoints)
      with pytest.raises(ValueError, match="Pass an RGB image"):
          one_channel = torch.randint(
              0, 256, size=(1, h, w), dtype=torch.uint8
          )
          utils.draw_keypoints(image=one_channel, keypoints=keypoints)
      with pytest.raises(
          ValueError, match="keypoints must be of shape"
      ):
          invalid_keypoints = torch.tensor(
              [[10, 10, 10, 10], [5, 6, 7, 8]], dtype=torch.float
          )
          utils.draw_keypoints(image=img, keypoints=invalid_keypoints)
  
imports: import os
  import re
  import sys
  import tempfile
  from io import BytesIO
  import numpy
  import pytest
  import torch
  import torchvision.transforms.functional
  import torchvision.utils
  from common_utils import assert_equal, cpu_and_cuda
  from PIL import __version__, Image, ImageColor
  from torchvision.transforms.v2.functional import to_dtype
label_desc: Use image node_id 20 for calling a global function with example usage: test_draw_keypoints_errors() without return types