code: def gazetteMatching(
      scored_blocks: Iterable[Scores],
      threshold: float = 0,
      n_matches: int = 1,
  ) -> ArrayLinks:
      for block in scored_blocks:
          block = block[block["score"] > threshold]
          block.sort(order="score")
          block = block[::-1]
  
          if len(block):
              if n_matches:
                  yield block[:n_matches].copy()
              else:
                  yield block.copy()
  
imports: from __future__ import annotations
  import array
  import itertools
  import logging
  import tempfile
  from collections import defaultdict
  from typing import Generator, Iterable, Sequence, cast
  import numpy
  import numpy.typing
  import scipy.cluster.hierarchy
  from dedupe._typing import ArrayLinks, Clusters, RecordID, Scores, TupleLinks
label_desc: Use image node_id 8 for calling a global function with example usage: gazetteMatching(scored_blocks, threshold, n_matches) without return types