def unique_justseen(iterable, key=None):
 imap = itertools.imap
 itemgetter = operator.itemgetter
 groupby = itertools.groupby
 return imap(next, imap(itemgetter(1), groupby(iterable, key)))

def unique_justseen ( iterable , key = None ) : imap = itertools . imap itemgetter = operator . itemgetter groupby = itertools . groupby return imap ( next , imap ( itemgetter ( 1 ) , groupby ( iterable , key ) ) )
list unique elements .