MCPcopy Index your code
hub / github.com/aws/aws-cli / register_feature_id

Function register_feature_id

awscli/botocore/useragent.py:110–126  ·  view source on GitHub ↗

Adds metric value to the current context object's ``features`` set. :type feature_id: str :param feature_id: The name of the feature to register. Value must be a key in the ``_USERAGENT_FEATURE_MAPPINGS`` dict.

(feature_id)

Source from the content-addressed store, hash-verified

108
109
110def register_feature_id(feature_id):
111 """Adds metric value to the current context object's ``features`` set.
112
113 :type feature_id: str
114 :param feature_id: The name of the feature to register. Value must be a key
115 in the ``_USERAGENT_FEATURE_MAPPINGS`` dict.
116 """
117 ctx = get_context()
118 if ctx is None:
119 # Never register features outside the scope of a
120 # ``botocore.context.start_as_current_context`` context manager.
121 # Otherwise, the context variable won't be reset and features will
122 # bleed into all subsequent requests. Return instead of raising an
123 # exception since this function could be invoked in a public interface.
124 return
125 if val := _USERAGENT_FEATURE_MAPPINGS.get(feature_id):
126 ctx.features.add(val)
127
128
129def register_feature_ids(feature_ids):

Callers 15

test_register_feature_idFunction · 0.90
_submit_transferMethod · 0.90
_submit_transferMethod · 0.90
_register_retriesMethod · 0.90
_gzip_compress_bodyFunction · 0.90
loadMethod · 0.90
loadMethod · 0.90
loadMethod · 0.90
loadMethod · 0.90
loadMethod · 0.90

Calls 2

get_contextFunction · 0.90
addMethod · 0.45