MCPcopy
hub / github.com/joowani/binarytree / pprint_with_index

Function pprint_with_index

tests/utils.py:41–49  ·  view source on GitHub ↗

Helper function for testing Node.pprint with indexes.

(values: NodeValueList)

Source from the content-addressed store, hash-verified

39
40
41def pprint_with_index(values: NodeValueList) -> List[str]:
42 """Helper function for testing Node.pprint with indexes."""
43 root = build(values)
44 assert root is not None
45
46 with CaptureOutput() as output:
47 root.pprint(index=True, delimiter=":")
48 assert output[0] == "" and output[-1] == ""
49 return [line for line in output if line != ""]
50
51
52def builtin_print(values: NodeValueList) -> List[str]:

Calls 3

buildFunction · 0.90
CaptureOutputClass · 0.85
pprintMethod · 0.80