code: def _match(filtered, matcher):
      
  
      def match_filtered_identities(x, ids, matcher):
          """Check if an identity matches a set of identities"""
  
          for y in ids:
              if x.uuid == y.uuid:
                  return True
              if matcher.match_filtered_identities(x, y):
                  return True
          return False
  
      # Find subsets of matches
      matched = []
  
      while filtered:
          candidates = []
          no_match = []
  
          x = filtered.pop(0)
  
          while matched:
              ids = matched.pop(0)
  
              if match_filtered_identities(x, ids, matcher):
                  candidates += ids
              else:
                  no_match.append(ids)
  
          candidates.append(x)
  
          # Generate the new list of matched subsets
          matched = [candidates] + no_match
  
      return matched
docs: Old method to find matches in a set of filtered identities.