code: def test_keypoint_vote(mock_obj, mock_det):
      vote_d = create_keypoints_voting_distance(
          keypoint_distance_threshold=np.sqrt(8),
          detection_threshold=0.5,
      )
  
      # perfect match
      det = mock_det(points=[[0, 0], [1, 1], [2, 2]], scores=0.6)
      obj = mock_obj(points=[[0, 0], [1, 1], [2, 2]], scores=0.6)
      np.testing.assert_almost_equal(
          vote_d(det, obj), 1 / 4
      )  # 3 matches
  
      # just under distance threshold
      det = mock_det(points=[[0, 0], [1, 1], [2, 2.0]], scores=0.6)
      obj = mock_obj(points=[[0, 0], [1, 1], [4, 3.9]], scores=0.6)
      np.testing.assert_almost_equal(
          vote_d(det, obj), 1 / 4
      )  # 3 matches
  
      # just above distance threshold
      det = mock_det(points=[[0, 0], [1, 1], [2, 2]], scores=0.6)
      obj = mock_obj(points=[[0, 0], [1, 1], [4, 4]], scores=0.6)
      np.testing.assert_almost_equal(
          vote_d(det, obj), 1 / 3
      )  # 2 matches
  
      # just under score threshold on detection
      det = mock_det(
          points=[[0, 0], [1, 1], [2, 2]], scores=[0.6, 0.6, 0.5]
      )
      obj = mock_obj(
          points=[[0, 0], [1, 1], [2, 2]], scores=[0.6, 0.6, 0.6]
      )
      np.testing.assert_almost_equal(
          vote_d(det, obj), 1 / 3
      )  # 2 matches
  
      # just under score threshold on tracked_object's last detection
      det = mock_det(
          points=[[0, 0], [1, 1], [2, 2]], scores=[0.6, 0.6, 0.6]
      )
      obj = mock_obj(
          points=[[0, 0], [1, 1], [2, 2]], scores=[0.6, 0.6, 0.5]
      )
      np.testing.assert_almost_equal(
          vote_d(det, obj), 1 / 3
      )  # 2 matches
  
      # no match because of scores
      det = mock_det(points=[[0, 0], [1, 1], [2, 2]], scores=0.5)
      obj = mock_obj(points=[[0, 0], [1, 1], [2, 2]], scores=0.5)
      np.testing.assert_almost_equal(vote_d(det, obj), 1)  # 0 matches
  
      # no match because of distances
      det = mock_det(points=[[0, 0], [1, 1], [2, 2]], scores=0.6)
      obj = mock_obj(points=[[2, 2], [3, 3], [4, 4]], scores=0.6)
      np.testing.assert_almost_equal(vote_d(det, obj), 1)
  
file_path: norfair/tests/test_distances.py
imports: import numpy
  import pytest
  from norfair.distances import ScalarDistance, ScipyDistance, VectorizedDistance, create_keypoints_voting_distance, create_normalized_mean_euclidean_distance, frobenius, get_distance_by_name
label_desc: Use image node_id 5 for calling a global function with example usage: test_keypoint_vote(mock_obj, mock_det) without return types