MCPcopy Create free account
hub / github.com/aws/aws-cli / set_context

Function set_context

awscli/botocore/context.py:47–58  ·  view source on GitHub ↗

Set the current ``_context`` context variable. :type ctx: ClientContext :param ctx: Client context object to set as the current context variable. :rtype: contextvars.Token :returns: Token object used to revert the context variable to what it was before the corresponding set

(ctx)

Source from the content-addressed store, hash-verified

45
46
47def set_context(ctx):
48 """Set the current ``_context`` context variable.
49
50 :type ctx: ClientContext
51 :param ctx: Client context object to set as the current context variable.
52
53 :rtype: contextvars.Token
54 :returns: Token object used to revert the context variable to what it was
55 before the corresponding set.
56 """
57 token = _context.set(ctx)
58 return token
59
60
61def reset_context(token):

Callers 3

test_set_contextMethod · 0.90
client_contextFunction · 0.90
start_as_current_contextFunction · 0.85

Calls

no outgoing calls

Tested by 2

test_set_contextMethod · 0.72
client_contextFunction · 0.72