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

Function get_or_create_cor_node

Lib/asyncio/tools.py:68–77  ·  view source on GitHub ↗

Get existing coroutine node or create new one under parent

(parent, frame)

Source from the content-addressed store, hash-verified

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:

Callers 1

_build_treeFunction · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…