pairs = takewhile(bool, (list(islice(groups, 2)) for _ in repeat(None)))
kept_pairs = (p for p in pairs if len(p[0]) == len(p[1]) == 1)
How to maintain a strict alternating pattern of item "types" in a list?