MCPcopy Create free account
hub / github.com/apple/coremltools / pairwise

Function pairwise

mlmodel/docs/preprocess.py:16–20  ·  view source on GitHub ↗

s -> (s0, s1), (s2, s3), (s4, s5), ...

(iterable)

Source from the content-addressed store, hash-verified

14 os.makedirs("./_sources/reference")
15
16 def pairwise(iterable):
17 "s -> (s0, s1), (s2, s3), (s4, s5), ..."
18
19 iteration = iter(iterable)
20 return izip(iteration, iteration)
21
22 sections = map(str.strip, re.split(r"<!--\s*(.+)\s*-->", text))
23 for section, content in pairwise(sections[1:]):

Callers 1

preprocessFunction · 0.85

Calls 1

iterFunction · 0.85

Tested by

no test coverage detected