MCPcopy Create free account
hub / github.com/Notgnoshi/generative / pairwise

Function pairwise

tools/render.py:38–46  ·  view source on GitHub ↗

Iterate over the given iterable in pairs. Example: s -> (s0,s1), (s1,s2), (s2, s3), ...

(iterable: Iterable)

Source from the content-addressed store, hash-verified

36
37
38def pairwise(iterable: Iterable) -> Iterable:
39 """Iterate over the given iterable in pairs.
40
41 Example:
42 s -> (s0,s1), (s1,s2), (s2, s3), ...
43 """
44 a, b = itertools.tee(iterable)
45 next(b, None)
46 return zip(a, b)
47
48
49def parse_args():

Callers 1

add_csFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected