#NEWLINE# def deduplicate_with_order( seq ) : #NEWLINE# #INDENT# 'Deduplicate a sequence while preserving the order\n    ' #NEWLINE# seen = set ( ) #NEWLINE# seen_add = seen . add #NEWLINE# return [ x for x in seq if ( not ( ( x in seen ) or seen_add ( x ) ) ) ]