def dedup(it):
    for _, group in groupby(it):
        for lab in group:
            yield lab
            break
Dedups a sorted iterable in constant memory.
dataset/ETHPy150Open dossier/dossier.web/dossier/web/routes.py/dedup