code: def grouped(self):
          
          for _ in self._match(self.matcher.root):
              yield list(self._internal_iter())
docs: Yield the matches grouped by their final state in the automaton, i.e. structurally identical patterns
          only differing in constraints will be yielded together. Each group is yielded as a list of tuples consisting of
          a pattern and a match substitution.
  
          Yields:
              The grouped matches.