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

Function _index

Lib/asyncio/tools.py:37–59  ·  view source on GitHub ↗
(result)

Source from the content-addressed store, hash-verified

35
36
37def _index(result):
38 id2name, awaits, task_stacks = {}, [], {}
39 for awaited_info in result:
40 for task_info in awaited_info.awaited_by:
41 task_id = task_info.task_id
42 task_name = task_info.task_name
43 id2name[task_id] = task_name
44
45 # Store the internal coroutine stack for this task
46 if task_info.coroutine_stack:
47 for coro_info in task_info.coroutine_stack:
48 call_stack = coro_info.call_stack
49 internal_stack = [_format_stack_entry(frame) for frame in call_stack]
50 task_stacks[task_id] = internal_stack
51
52 # Add the awaited_by relationships (external dependencies)
53 if task_info.awaited_by:
54 for coro_info in task_info.awaited_by:
55 call_stack = coro_info.call_stack
56 parent_task_id = coro_info.task_name
57 stack = [_format_stack_entry(frame) for frame in call_stack]
58 awaits.append((parent_task_id, stack, task_id))
59 return id2name, awaits, task_stacks
60
61
62def _build_tree(id2name, awaits, task_stacks):

Callers 8

_check_date_fieldsFunction · 0.85
_check_time_fieldsFunction · 0.85
randrangeMethod · 0.85
randintMethod · 0.85
binomialvariateMethod · 0.85
__int__Method · 0.85
build_async_treeFunction · 0.85
build_task_tableFunction · 0.85

Calls 2

_format_stack_entryFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…