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

Function _task_graph

Lib/asyncio/tools.py:105–110  ·  view source on GitHub ↗

Return {parent_task_id: {child_task_id, …}, …}.

(awaits)

Source from the content-addressed store, hash-verified

103
104# ─── detect cycles in the task-to-task graph ───────────────────────
105def _task_graph(awaits):
106 """Return {parent_task_id: {child_task_id, …}, …}."""
107 g = defaultdict(set)
108 for parent_id, _stack, child_id in awaits:
109 g[parent_id].add(child_id)
110 return g
111
112
113def _find_cycles(graph):

Callers 1

build_async_treeFunction · 0.85

Calls 2

defaultdictClass · 0.85
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…