def all_equal(iterable):
    """Return True if all the elements are equal to each other
    (or if the input is an empty sequence), False otherwise."""
    g = itertools.groupby(iterable)
    return next(g, True) and not next(g, False)
Return True if all the elements are equal to each other
    (or if the input is an empty sequence), False otherwise.
spacy/util.py