ó
    Ú°›jÆ  ã                   ó¦   • S r SSKJr  SSKJr  SSKJr  SSKJrJ	r	  SSK
Jr  \ " S S5      5       r\" S	5      rS
 rS rS r\SS j5       rSS jrg)z”
NOTE: All classes and functions in this module are considered private and are
subject to abrupt breaking changes. Please do not use them directly.
é    )Úcontextmanager)Ú
ContextVar)Údeepcopy)Ú	dataclassÚfield©Úwrapsc                   ó6   • \ rS rSr% Sr\" \S9r\\   \	S'   Sr
g)ÚClientContexté   zö
Encapsulation of objects tracked within the ``_context`` context variable.

``features`` is a set responsible for storing features used during
preparation of an AWS request. ``botocore.useragent.register_feature_id``
is used to add to this set.
)Údefault_factoryÚfeatures© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Úsetr   ÚstrÚ__annotations__Ú__static_attributes__r   ó    ÚM/home/mande/repo/quber/.venv/lib/python3.13/site-packages/botocore/context.pyr   r      s   ‡ ññ ¨sÑ3€Hˆc�#‰hÖ3r   r   Ú_contextc                  ó,   • [         R                  S5      $ )z@Get the current ``_context`` context variable if set, else None.N)r   Úgetr   r   r   Úget_contextr   )   s   € ä�<‰<˜ÓÐr   c                 ó0   • [         R                  U 5      nU$ )a  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.
)r   r   )ÚctxÚtokens     r   Úset_contextr"   .   s   € ô �L‰L˜Ó€EØ€Lr   c                 ó.   • [         R                  U 5        g)z‹Reset the current ``_context`` context variable.

:type token: contextvars.Token
:param token: Token object to reset the context variable.
N)r   Úreset)r!   s    r   Úreset_contextr%   <   s   € ô ‡N�N�5Õr   Nc              #   óº   #   • U =(       d
    [        5       nUc  [        5       nO[        U5      n[        U5      n Sv •  [	        U5        g! [	        U5        f = f7f)aO  
Context manager that copies the passed or current context object and sets
it as the current context variable. If no context is found, a new
``ClientContext`` object is created. It mainly ensures the context variable
is reset to the previous value once the executed code returns.

Example usage:

    def my_feature():
        with start_as_current_context():
            register_feature_id('MY_FEATURE')
            pass

:type ctx: ClientContext
:param ctx: The client context object to set as the new context variable.
    If not provided, the current or a new context variable is used.
N)r   r   r   r"   r%   )r    ÚcurrentÚnewr!   s       r   Ústart_as_current_contextr)   E   sK   é € ð& ×"”[“]€GØ�Ü‹o‰ä�wÓˆÜ˜Ó€EðÛä�eÕøŒ�eÕüs   ‚8A»A ¿AÁAÁAc                 ó   ^ • U 4S jnU$ )aÏ  
Decorator that wraps ``start_as_current_context`` and optionally invokes a
hook within the newly-set context. This is just syntactic sugar to avoid
indenting existing code under the context manager.

Example usage:

    @with_current_context(partial(register_feature_id, 'MY_FEATURE'))
    def my_feature():
        pass

:type hook: callable
:param hook: A callable that will be invoked within the scope of the
    ``start_as_current_context`` context manager.
c                 ó4   >^ • [        T 5      U U4S j5       nU$ )Nc                  óz   >• [        5          T(       a  T" 5         T" U 0 UD6sS S S 5        $ ! , (       d  f       g = f©N)r)   )ÚargsÚkwargsÚfuncÚhooks     €€r   ÚwrapperÚ8with_current_context.<locals>.decorator.<locals>.wrapperv   s*   ø€ ä)Õ+ÞÙ”FÙ˜TÐ, VÑ,÷ ,×+×+ús   Œ,¬
:r   )r0   r2   r1   s   ` €r   Ú	decoratorÚ'with_current_context.<locals>.decoratoru   s    ù€ Ü	ˆt‹õ	-ó 
ð	-ð ˆr   r   )r1   r4   s   ` r   Úwith_current_contextr6   d   s   ø€ õ"ð Ðr   r-   )r   Ú
contextlibr   Úcontextvarsr   Úcopyr   Údataclassesr   r   Ú	functoolsr	   r   r   r   r"   r%   r)   r6   r   r   r   Ú<module>r<      sh   ðñõ
 &Ý "Ý ß (Ý ð ÷	4ð 	4ó ð	4ñ �jÓ!€òò
òð óó ðõ<r   