MCPcopy Index your code
hub / github.com/clips/pattern / unique

Function unique

pattern/text/search.py:107–111  ·  view source on GitHub ↗

Returns a list copy in which each item occurs only once (in-order).

(iterable)

Source from the content-addressed store, hash-verified

105# so we need to find all possible variations of a pattern.
106
107def unique(iterable):
108 """ Returns a list copy in which each item occurs only once (in-order).
109 """
110 seen = set()
111 return [x for x in iterable if x not in seen and not seen.add(x)]
112
113def find(function, iterable):
114 """ Returns the first item in the list for which function(item) is True, None otherwise.

Callers 3

parentsMethod · 0.70
childrenMethod · 0.70
constituentsMethod · 0.70

Calls 1

addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…