code: def test_gazette_matching(self):
      gazetteMatch = dedupe.clustering.gazetteMatching
      blocked_dupes = itertools.groupby(
          self.bipartite_dupes, key=lambda x: x[0][0]
      )
  
      def to_numpy(x):
          return numpy.array(
              x, dtype=[("ids", int, 2), ("score", float)]
          )
  
      blocked_dupes = [
          to_numpy(list(block)) for _, block in blocked_dupes
      ]
  
      target = [
          (((1, 6), 0.72), ((1, 8), 0.6)),
          (((2, 7), 0.72), ((2, 8), 0.3)),
          (((3, 6), 0.72), ((3, 8), 0.65)),
          (((4, 6), 0.96), ((4, 5), 0.63)),
          (((5, 8), 0.24),),
      ]
  
      assert [
          tuple((tuple(pair), score) for pair, score in each.tolist())
          for each in gazetteMatch(blocked_dupes, n_matches=2)
      ] == target
  
file_path: dedupe/tests/test_dedupe.py
imports: import itertools
  import unittest
  import numpy
  import dedupe
label_desc: Use image node_id 5 for calling the ClusteringTest obj's underlying member method code with example usage: obj.test_gazette_matching() and returns: numpy