MCPcopy Index your code
hub / github.com/python/cpython / take

Function take

Lib/test/test_itertools.py:61–63  ·  view source on GitHub ↗

Convenience function for partially consuming a long of infinite iterable

(n, seq)

Source from the content-addressed store, hash-verified

59 raise StopIteration
60
61def take(n, seq):
62 'Convenience function for partially consuming a long of infinite iterable'
63 return list(islice(seq, n))
64
65def prod(iterable):
66 return reduce(operator.mul, iterable, 1)

Callers 14

test_chainMethod · 0.85
test_countMethod · 0.85
test_count_with_stepMethod · 0.85
test_cycleMethod · 0.85
test_filterMethod · 0.85
test_filterfalseMethod · 0.85
test_zipMethod · 0.85
test_ziplongestMethod · 0.85
test_repeatMethod · 0.85
test_mapMethod · 0.85
test_starmapMethod · 0.85

Calls 1

listClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…