Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/MagicStack/contextvars
/ _get_context
Function
_get_context
contextvars/__init__.py:188–193 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
186
187
188
def
_get_context():
189
ctx = getattr(_state,
'context'
, None)
190
if
ctx is None:
191
ctx = Context()
192
_state.context = ctx
193
return
ctx
194
195
196
def
_set_context(ctx):
Callers
5
run
Method · 0.85
get
Method · 0.85
set
Method · 0.85
reset
Method · 0.85
copy_context
Function · 0.85
Calls
1
Context
Class · 0.85
Tested by
no test coverage detected
Used in the wild
real call sites across dependent graphs
searching dependent graphs…