nodupes = [{i} for i in xrange(100)]
mostlydupes = [set(range(100)) - {i} for i in xrange(100)]
import timeit
print timeit.timeit('''
element_counts = collections.Counter(itertools.chain.from_iterable(allsets))
nondupes = [{elem for elem in original if element_counts[elem] == 1}
for original in allsets]
''', setup='import itertools; import collections; from __main__ import nodupes as allsets', number=1000)
print timeit.timeit('''
element_counts = collections.Counter(itertools.chain.from_iterable(allsets))
unique_elements = {elem for elem, count in element_counts.viewitems() if count == 1}
nondupes = [original & unique_elements for original in allsets]
''', setup='import itertools; import collections; from __main__ import nodupes as allsets', number=1000)
print timeit.timeit('''
element_counts = collections.Counter(itertools.chain.from_iterable(allsets))
nondupes = [{elem for elem in original if element_counts[elem] == 1}
for original in allsets]
''', setup='import itertools; import collections; from __main__ import mostlydupes as allsets', number=100)
print timeit.timeit('''
element_counts = collections.Counter(itertools.chain.from_iterable(allsets))
unique_elements = {elem for elem, count in element_counts.viewitems() if count == 1}
nondupes = [original & unique_elements for original in allsets]
''', setup='import itertools; import collections; from __main__ import mostlydupes as allsets', number=100)
bm9kdXBlcyA9IFt7aX0gZm9yIGkgaW4geHJhbmdlKDEwMCldCm1vc3RseWR1cGVzID0gW3NldChyYW5nZSgxMDApKSAtIHtpfSBmb3IgaSBpbiB4cmFuZ2UoMTAwKV0KaW1wb3J0IHRpbWVpdAoKcHJpbnQgdGltZWl0LnRpbWVpdCgnJycKZWxlbWVudF9jb3VudHMgPSBjb2xsZWN0aW9ucy5Db3VudGVyKGl0ZXJ0b29scy5jaGFpbi5mcm9tX2l0ZXJhYmxlKGFsbHNldHMpKQpub25kdXBlcyA9IFt7ZWxlbSBmb3IgZWxlbSBpbiBvcmlnaW5hbCBpZiBlbGVtZW50X2NvdW50c1tlbGVtXSA9PSAxfQogICAgICAgICAgICBmb3Igb3JpZ2luYWwgaW4gYWxsc2V0c10KJycnLCBzZXR1cD0naW1wb3J0IGl0ZXJ0b29sczsgaW1wb3J0IGNvbGxlY3Rpb25zOyBmcm9tIF9fbWFpbl9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