MCPcopy
hub / github.com/pimutils/vdirsyncer / uniq

Function uniq

vdirsyncer/utils.py:48–56  ·  view source on GitHub ↗

Filter duplicates while preserving order. ``set`` can almost always be used instead of this, but preserving order might prove useful for debugging.

(s)

Source from the content-addressed store, hash-verified

46
47
48def uniq(s):
49 '''Filter duplicates while preserving order. ``set`` can almost always be
50 used instead of this, but preserving order might prove useful for
51 debugging.'''
52 d = set()
53 for x in s:
54 if x not in d:
55 d.add(x)
56 yield x
57
58
59def get_etag_from_file(f):

Callers 3

join_collectionFunction · 0.85
get_multiMethod · 0.85
_get_actionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected