code: def _get_matching_pairs(
      self, query_emb, ref_emb, threshold, return_tuples
  ):
      mat = self.distance(query_emb, ref_emb)
      matches = (
          mat >= threshold
          if self.distance.is_inverted
          else mat <= threshold
      )
      matches = matches.cpu().numpy()
      if return_tuples:
          return list(zip(*np.where(matches)))
      return matches
  
imports: import numpy
  import torch
  from ..distances import BatchedDistance, CosineSimilarity
  from .None import common_functions
label_desc: Use image node_id 4 for calling the MatchFinder obj's underlying member method code with example usage: obj._get_matching_pairs(query_emb, ref_emb, threshold, return_tuples) and returns: matches, list