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

Function zip

pattern/text/tree.py:62–68  ·  view source on GitHub ↗

Returns a list of tuples, where the i-th tuple contains the i-th element from each of the argument sequences or iterables (or default if too short).

(*args, **default)

Source from the content-addressed store, hash-verified

60
61_zip = zip
62def zip(*args, **default):
63 """ Returns a list of tuples, where the i-th tuple contains the i-th element
64 from each of the argument sequences or iterables (or default if too short).
65 """
66 args = [list(iterable) for iterable in args]
67 n = max(map(len, args))
68 return _zip(*[i + [default.get("default", None)] * (n-len(i)) for i in args])
69
70def unzip(i, iterable):
71 """ Returns the item at the given index from inside each tuple in the list.

Callers 15

evaluationsFunction · 0.85
evaluationsFunction · 0.85
genFieldsFunction · 0.85
__str__Method · 0.85
genFieldsFunction · 0.85
__str__Method · 0.85
decodeMethod · 0.85
create_unicode_mapMethod · 0.85
__eq__Method · 0.85
createMethod · 0.85
SQLMethod · 0.85
recordMethod · 0.85

Calls 2

lenFunction · 0.85
getMethod · 0.45

Tested by 2

test_stemMethod · 0.68
renderMethod · 0.68