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

Function pairwise

tools/random-production-rules.py:273–277  ·  view source on GitHub ↗

Pairwise: s -> (s0,s1), (s1,s2), (s2, s3), ...

(iterable)

Source from the content-addressed store, hash-verified

271
272
273def pairwise(iterable):
274 """Pairwise: s -> (s0,s1), (s1,s2), (s2, s3), ..."""
275 a, b = itertools.tee(iterable)
276 next(b, None)
277 return zip(a, b)
278
279
280def main(args):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected