def first_occurences(iterable):
    """
    Given an iterable, return a generator of value first occurences only.
    """
    seen = set()
    for x in iterable:
        if x not in seen:
            seen.add(x)
            yield x
