def unique(list_, key=(lambda x: x)):
 seen = {}
 result = []
 for item in list_:
  seenkey = key(item)
  if (seenkey in seen):
   continue
  seen[seenkey] = 1
  result.append(item)
 return result

def unique ( list_ , key = ( lambda x : x ) ) : seen = { } result = [ ] for item in list_ : seenkey = key ( item ) if ( seenkey in seen ) : continue seen [ seenkey ] = 1 result . append ( item ) return result
return only unique elements of a sequence .