code: def unique(seq, preserve_order=True):
      
      if preserve_order:
          # f8 by Dave Kirby
          # Order preserving
          seen = set()
          seen_add = seen.add  # lookup method only once
          return [x for x in seq if x not in seen and not seen_add(x)]
      # f9
      # Not order preserving
      return list({}.fromkeys(seq).keys())
docs: Take a sequence and make it unique.  Not preserving order is faster, but
          that won't matter so much for most uses.
  
          copied from: http://www.peterbe.com/plog/uniqifiers-benchmark/uniqifiers_benchmark.py