MCPcopy Create free account
hub / github.com/pyload/pyload / uniqify

Function uniqify

module/utils.py:120–134  ·  view source on GitHub ↗
(seq, idfun=None)

Source from the content-addressed store, hash-verified

118
119
120def uniqify(seq, idfun=None):
121# order preserving
122 if idfun is None:
123 def idfun(x): return x
124 seen = {}
125 result = []
126 for item in seq:
127 marker = idfun(item)
128 # in old Python versions:
129 # if seen.has_key(marker)
130 # but in new ones:
131 if marker in seen: continue
132 seen[marker] = 1
133 result.append(item)
134 return result
135
136
137def parseFileSize(string, unit=None): #returns bytes

Callers 1

getEventsMethod · 0.90

Calls 2

idfunFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected