code: def _get_stmt_matching_groups(stmts):
          
          def match_func(x): return x.matches_key()
  
          # Remove exact duplicates using a set() call, then make copies:
          logger.debug('%d statements before removing object duplicates.' %
                       len(stmts))
          st = list(set(stmts))
          logger.debug('%d statements after removing object duplicates.' %
                       len(stmts))
          # Group statements according to whether they are matches (differing
          # only in their evidence).
          # Sort the statements in place by matches_key()
          st.sort(key=match_func)
  
          return itertools.groupby(st, key=match_func)
docs: Use the matches_key method to get sets of matching statements.