human
Complete this python program:
def UniqueIterator(iterator, key=(lambda x: x)):
assistant
#Here is the Python program you requested.

    """Takes an iterator and returns an iterator that returns only the
    first occurence of each entry
    """
    so_far = set()
    def no_dups(x):
        k = key(x)
        if (k in so_far):
            return False
        else:
            so_far.add(k)
            return True
    return IteratorFilter(iterator, no_dups)