+
     Ii  c                   s    R t ^ RIHt ^ RIHt ^ RIHt ^ RIHtH	t	 ^ RI
Ht ] ! R R4      4       t]! R4      tR	 tR
 tR t]RR l4       tRR ltR# )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                   sB   a  ] tR t^t o Rt]! ]R7      tV 3R ltRt	V t
R# )ClientContextz
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.
)Zdefault_factoryc                s6   < V ^8  d   Qh/ S[ S[,          ;R&   # )i   features)setZstr)Zformat__classdict__s   "5/usr/lib/python3.14/site-packages/botocore/context.pyZ__annotate__ZClientContext.__annotate__   s      #h3      N)Z__name__Z
__module__Z__qualname__Z__firstlineno____doc__r   r	   r   Z__annotate_func__Z__static_attributes__Z__classdictcell__)r
   s   @r   r   r      s      s3H  r   r   _contextc                 s,    \         P                  R4      # )z@Get the current ``_context`` context variable if set, else None.N)r   Zgetr   r   r   get_contextr   )   s    <<r   c                s0    \         P                  V 4      pV# )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     LLELr   c                s0    \         P                  V 4       R# )zReset the current ``_context`` context variable.

:type token: contextvars.Token
:param token: Token object to reset the context variable.
N)r   Zreset)r   s   &r   reset_contextr   <   s     NN5r   Nc              #  s   "   T ;'       g    \        4       pVf   \        4       pM\        V4      p\        V4      p Rx  \	        V4       R#   \	        T4       i ; i5i)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   ZcurrentZnewr   s   &   r   start_as_current_contextr   E   sN     & ""[]GowEees   :AA AAAc                s   a  V 3R lpV# )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                 s4   <a  \        S 4      V V3R  l4       pV# )c                  s   < \        4       ;_uu_ 4        S'       d   S! 4        S! V / VB uuR R R 4       #   + '       g   i     R # ; iN)r   )ZargsZkwargsfunchooks   *,r   wrapperZ8with_current_context.<locals>.decorator.<locals>.wrapperv   s0    )++FT,V, ,+++s	   6A	r   )r   r   r   s   f r   	decoratorZ'with_current_context.<locals>.decoratoru   s     	t	- 
	- r   r   )r   r   s   f r   with_current_contextr   d   s    " r   r   )r   Z
contextlibr    Zcontextvarsr   Zcopyr   Zdataclassesr   r   Z	functoolsr   r   r   r   r   r   r   r   r   r   r   <module>r      sh   
 & "  (  	4 	4 	4 j!
  <r   