MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _gen_pairs

Function _gen_pairs

tensorflow/tools/docs/parser.py:493–508  ·  view source on GitHub ↗

Given an list of items [a,b,a,b...], generate pairs [(a,b),(a,b)...]. Args: items: A list of items (length must be even) Yields: The original items, in pairs

(items)

Source from the content-addressed store, hash-verified

491
492
493def _gen_pairs(items):
494 """Given an list of items [a,b,a,b...], generate pairs [(a,b),(a,b)...].
495
496 Args:
497 items: A list of items (length must be even)
498
499 Yields:
500 The original items, in pairs
501 """
502 assert len(items) % 2 == 0
503 items = iter(items)
504 while True:
505 try:
506 yield next(items), next(items)
507 except StopIteration:
508 return
509
510
511class _FunctionDetail(

Callers 1

_parse_function_detailsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected