Get existing coroutine node or create new one under parent
(parent, frame)
| 66 | next_cor_id = count(1) |
| 67 | |
| 68 | def get_or_create_cor_node(parent, frame): |
| 69 | """Get existing coroutine node or create new one under parent""" |
| 70 | if frame in cor_nodes[parent]: |
| 71 | return cor_nodes[parent][frame] |
| 72 | |
| 73 | node_key = (NodeType.COROUTINE, f"c{next(next_cor_id)}") |
| 74 | id2label[node_key] = frame |
| 75 | children[parent].append(node_key) |
| 76 | cor_nodes[parent][frame] = node_key |
| 77 | return node_key |
| 78 | |
| 79 | # Build task dependency tree with coroutine frames |
| 80 | for parent_id, stack, child_id in awaits: |
no test coverage detected
searching dependent graphs…