Label boxes in graph by chunk index >>> box_label(('x', 1, 2, 3)) '(1, 2, 3)' >>> box_label(('x', 123)) '123' >>> box_label('x') ''
(key, verbose=False)
| 103 | |
| 104 | |
| 105 | def box_label(key, verbose=False): |
| 106 | """Label boxes in graph by chunk index |
| 107 | |
| 108 | >>> box_label(('x', 1, 2, 3)) |
| 109 | '(1, 2, 3)' |
| 110 | >>> box_label(('x', 123)) |
| 111 | '123' |
| 112 | >>> box_label('x') |
| 113 | '' |
| 114 | """ |
| 115 | if isinstance(key, tuple): |
| 116 | key = key[1:] |
| 117 | if len(key) == 1: |
| 118 | [key] = key |
| 119 | return str(key) |
| 120 | elif verbose: |
| 121 | return str(key) |
| 122 | else: |
| 123 | return "" |
| 124 | |
| 125 | |
| 126 | def to_graphviz( |
no outgoing calls
no test coverage detected