ó
    +K£j¼K  ã                   óþ   • S r SSKJr  SSKJrJr  SSKJrJrJ	r	J
r
  SSKJr   " S S\	5      r " S	 S
\	5      r " S S\5      r " S S\
5      r " S S5      r " S S\5      r\rSSS\
S.S jjr " S S\5      r\rg)zoThis module implements decorators for implementing other decorators
as well as some commonly used decorators.

é    )Úpartial)ÚisclassÚ	signatureé   )ÚBaseObjectProxyÚBoundFunctionWrapperÚCallableObjectProxyÚFunctionWrapper)Úformatargspecc                   óx   ^ • \ rS rSrU 4S jr\S 5       r\S 5       r\S 5       r\S 5       r	\S 5       r
SrU =r$ )	Ú_AdapterFunctionCodeé   c                 ó8   >• [         [        U ]  U5        X l        g ©N)Úsuperr   Ú__init__Ú_self_adapter_code)ÚselfÚwrapped_codeÚadapter_codeÚ	__class__s      €ÚžC:\Users\johnn\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\wrapt/decorators.pyr   Ú_AdapterFunctionCode.__init__   s   ø€ ô 	Ô" DÑ2°<Ô@Ø".Õó    c                 ó.   • U R                   R                  $ r   )r   Úco_argcount©r   s    r   r   Ú _AdapterFunctionCode.co_argcount    ó   € à×&Ñ&×2Ñ2Ð2r   c                 ó.   • U R                   R                  $ r   )r   Úco_coder   s    r   r!   Ú_AdapterFunctionCode.co_code$   s   € à×&Ñ&×.Ñ.Ð.r   c                 ó.   • U R                   R                  $ r   )r   Úco_flagsr   s    r   r$   Ú_AdapterFunctionCode.co_flags(   s   € à×&Ñ&×/Ñ/Ð/r   c                 ó.   • U R                   R                  $ r   )r   Úco_kwonlyargcountr   s    r   r'   Ú&_AdapterFunctionCode.co_kwonlyargcount,   s   € à×&Ñ&×8Ñ8Ð8r   c                 ó.   • U R                   R                  $ r   )r   Úco_varnamesr   s    r   r*   Ú _AdapterFunctionCode.co_varnames0   r   r   )r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   Úpropertyr   r!   r$   r'   r*   Ú__static_attributes__Ú__classcell__©r   s   @r   r   r      sl   ø† õ/ð ñ3ó ð3ð ñ/ó ð/ð ñ0ó ð0ð ñ9ó ð9ð ñ3ó ö3r   r   c                   óh   ^ • \ rS rSrU 4S jr\S 5       r\S 5       r\S 5       r\S 5       r	Sr
U =r$ )Ú_AdapterFunctionSurrogateé5   c                 ó8   >• [         [        U ]  U5        X l        g r   )r   r5   r   Ú_self_adapter)r   ÚwrappedÚadapterr   s      €r   r   Ú"_AdapterFunctionSurrogate.__init__7   s   ø€ ô 	Ô'¨Ñ7¸Ô@Ø$Õr   c                 ój   • [        U R                  R                  U R                  R                  5      $ r   )r   Ú__wrapped__Ú__code__r8   r   s    r   r>   Ú"_AdapterFunctionSurrogate.__code__>   s,   € ä#Ø×Ñ×%Ñ% t×'9Ñ'9×'BÑ'Bó
ð 	
r   c                 ó.   • U R                   R                  $ r   )r8   Ú__defaults__r   s    r   rA   Ú&_AdapterFunctionSurrogate.__defaults__D   s   € à×!Ñ!×.Ñ.Ð.r   c                 ó.   • U R                   R                  $ r   )r8   Ú__kwdefaults__r   s    r   rD   Ú(_AdapterFunctionSurrogate.__kwdefaults__H   s   € à×!Ñ!×0Ñ0Ð0r   c                 ó,   • [        U R                  5      $ r   )r   r8   r   s    r   Ú__signature__Ú'_AdapterFunctionSurrogate.__signature__L   s   € ä˜×+Ñ+Ó,Ð,r   )r8   )r,   r-   r.   r/   r   r0   r>   rA   rD   rG   r1   r2   r3   s   @r   r5   r5   5   sX   ø† õ%ð ñ
ó ð
ð
 ñ/ó ð/ð ñ1ó ð1ð ñ-ó ö-r   r5   c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)Ú_BoundAdapterFunctionWrapperéQ   c                 ój   • [        U R                  R                  U R                  R                  5      $ r   )r5   r=   Ú__func__Ú_self_parentr8   r   s    r   rM   Ú%_BoundAdapterFunctionWrapper.__func__S   s,   € ä(Ø×Ñ×%Ñ% t×'8Ñ'8×'FÑ'Fó
ð 	
r   c                 ó@   • [        U R                  R                  5      $ r   )r   rN   r8   r   s    r   rG   Ú*_BoundAdapterFunctionWrapper.__signature__Y   s   € ä˜×*Ñ*×8Ñ8Ó9Ð9r   © N)r,   r-   r.   r/   r0   rM   rG   r1   rR   r   r   rJ   rJ   Q   s(   † àñ
ó ð
ð
 ñ:ó ó:r   rJ   c                   ól   ^ • \ rS rSr\rU 4S jr\S 5       r\S 5       r	\S 5       r
\S 5       rSrU =r$ )Ú_AdapterFunctionWrapperé^   c                 ó’   >• UR                  S5      n[        [        U ]  " U0 UD6  [	        U R
                  U5      U l        X0l        g )Nr:   )Úpopr   rT   r   r5   r=   Ú_self_surrogater8   )r   ÚargsÚkwargsr:   r   s       €r   r   Ú _AdapterFunctionWrapper.__init__b   sC   ø€ Ø—*‘*˜YÓ'ˆô 	Ô% tÒ5°tÐF¸vÒFÜ8¸×9IÑ9IÈ7ÓSˆÔØ$Õr   c                 ó.   • U R                   R                  $ r   )rX   r>   r   s    r   r>   Ú _AdapterFunctionWrapper.__code__k   s   € à×#Ñ#×,Ñ,Ð,r   c                 ó.   • U R                   R                  $ r   )rX   rA   r   s    r   rA   Ú$_AdapterFunctionWrapper.__defaults__o   s   € à×#Ñ#×0Ñ0Ð0r   c                 ó.   • U R                   R                  $ r   )rX   rD   r   s    r   rD   Ú&_AdapterFunctionWrapper.__kwdefaults__s   s   € à×#Ñ#×2Ñ2Ð2r   c                 ó.   • U R                   R                  $ r   )rX   rG   r   s    r   rG   Ú%_AdapterFunctionWrapper.__signature__w   s   € à×#Ñ#×1Ñ1Ð1r   )r8   rX   )r,   r-   r.   r/   rJ   Ú__bound_function_wrapper__r   r0   r>   rA   rD   rG   r1   r2   r3   s   @r   rT   rT   ^   s^   ø† à!=Ðõ%ð ñ-ó ð-ð ñ1ó ð1ð ñ3ó ð3ð ñ2ó ö2r   rT   c                   ó   • \ rS rSrS rSrg)ÚAdapterFactoryé|   c                 ó   • [        5       er   )ÚNotImplementedError©r   r9   s     r   Ú__call__ÚAdapterFactory.__call__}   s   € Ü!Ó#Ð#r   rR   N)r,   r-   r.   r/   rk   r1   rR   r   r   rf   rf   |   s   † õ$r   rf   c                   ó.   ^ • \ rS rSrU 4S jrS rSrU =r$ )Ú_DelegatedAdapterFactoryé�   c                 ó6   >• [         [        U ]  5         Xl        g r   )r   rn   r   Úfactory)r   rq   r   s     €r   r   Ú!_DelegatedAdapterFactory.__init__‚   s   ø€ äÔ&¨Ñ6Ô8Ø�r   c                 ó$   • U R                  U5      $ r   ©rq   rj   s     r   rk   Ú!_DelegatedAdapterFactory.__call__‡   s   € Ø�|‰|˜GÓ$Ð$r   rt   )r,   r-   r.   r/   r   rk   r1   r2   r3   s   @r   rn   rn   �   s   ø† õ÷
%ð %r   rn   N©Úenabledr:   Úproxyc               ól   ^ ^^^^• T b  SU4S jjmUUUU 4S jnT" T U[         S9$ [        [         TTTS9$ )aw  
The decorator should be supplied with a single positional argument
which is the `wrapper` function to be used to implement the
decorator. This may be preceded by a step whereby the keyword
arguments are supplied to customise the behaviour of the
decorator. The `adapter` argument is used to optionally denote a
separate function which is notionally used by an adapter
decorator. In that case parts of the function `__code__` and
`__defaults__` attributes are used from the adapter function
rather than those of the wrapped function. This allows for the
argument specification from `inspect.getfullargspec()` and similar
functions to be overridden with a prototype for a different
function than what was wrapped. The `enabled` argument provides a
way to enable/disable the use of the decorator. If the type of
`enabled` is a boolean, then it is evaluated immediately and the
wrapper not even applied if it is `False`. If not a boolean, it will
be evaluated when the wrapper is called for an unbound wrapper,
and when binding occurs for a bound wrapper. When being evaluated,
if `enabled` is callable it will be called to obtain the value to
be checked. If `False`, the wrapper will not be called and instead
the original wrapped function will be called directly instead.
The `proxy` argument provides a way of passing a custom version of
the `FunctionWrapper` class used in decorating the function.
c                 óF  >• U(       a“  [        U[        5      (       a  U" U 5      n[        U5      (       d\  0 n0 n[        U[        5      (       d!  [	        U5      S:X  a
  US   nUS S n[        U6 n[        SU S3XD5        US   nU(       a  XSl        [        XX#S9$ T" XUS9$ )Né   éÿÿÿÿzdef adapterz: passr:   )r9   Úwrapperrw   r:   )r9   r}   rw   )	Ú
isinstancerf   ÚcallableÚstrÚlenr   ÚexecÚ__annotations__rT   )r9   r}   rw   r:   ÚnsÚannotationsrx   s         €r   Ú_buildÚdecorator.<locals>._build³   s³   ø€ ÞÜ˜g¤~×6Ñ6Ù% gÓ.�Gä ×(Ñ(Ø�Bð #%�Kä% g¬s×3Ñ3Ü˜w›<¨1Ó,Ø*1°"©+˜KØ&-¨c¨r l˜GÜ"/°Ð"9˜ä˜; w i¨vÐ6¸Ô?Ø  ™m�Gö #Ø2=Ô/ä.Ø#¸gñð ñ  À7ÑKÐKr   c                 óh  >^ ^• Uc#  [        T 5      (       a  U(       d  UU	U
UU 4S jnU$ US   nT
n[        U5      [        L a  U(       d  U$ S nUc  [        T 5      (       a  T " 5       nOATnO>[        U5      (       a  TR                  S U5      nOTR                  U[        U5      5      nT" XWUT	5      $ )Nc                 óf   >• Tn[        U5      [        L a  U(       d  U $ S nT" S0 TD6nT" XUT5      $ )NrR   )ÚtypeÚbool)Útarget_wrappedÚ_enabledÚtarget_wrapperr†   r:   rw   rZ   r9   s      €€€€€r   Ú_captureÚ-decorator.<locals>._wrapper.<locals>._captureü   sD   ø€ ð  '�HÜ˜H“~¬Ò-Þ'Ø#1Ð1Ø#'˜ñ &-Ñ%6¨vÑ%6�Nñ " .À(ÈGÓTÐTr   r   )r   rŠ   r‹   Ú__get__)r9   ÚinstancerY   rZ   r�   rŒ   r�   rŽ   r†   r:   rw   r}   s   `  `    €€€€r   Ú_wrapperÚdecorator.<locals>._wrapperâ   s¿   ú€ ð* Ñ¤G¨G×$4Ñ$4¾T÷
Uñ Uð2  �ð
 " !™WˆNð ˆHÜ�H‹~¤Ò%ÞØ)Ð)Ø�ð
 ÑÜ˜7×#Ñ#ñ, &-£Y‘Nð$ &-‘Nô ˜8×$Ñ$ð. &-§_¡_°T¸8Ó%D‘Nð0 &-§_¡_°X¼tÀH»~Ó%N�Nñ ˜.¸(ÀGÓLÐLr   )r:   rv   )NN)Ú	decoratorr   )r}   rw   r:   rx   r“   r†   s   ```` @r   r•   r•   •   sE   ü€ ð4 Ñ÷&	L÷^f	Mð f	Mñ^ �g˜x´Ñ;Ð;ô ”y¨'¸7È%ÑPÐPr   c                   ó@   ^ • \ rS rSrSrSS.U 4S jjrS rS rSrU =r	$ )	Ú_StateBindingWrapperi¦  a  A descriptor decorator that binds the owner instance to wrappers
produced by a wrapper factory method.

When applied on top of a method decorated with ``function_wrapper``
or ``decorator``, it intercepts the descriptor ``__get__`` so that
when the method is accessed through an instance, the owner instance
is automatically attached as an attribute on the resulting wrapper
via ``__self_setattr__``.

The *name* keyword argument controls the attribute name under which
the owner instance is stored on the wrapper (default ``"state"``).
Ústate)Únamec                ó0   >• [         TU ]  S 5        Xl        g r   )r   r   Ú_self_attr_name)r   r™   r   s     €r   r   Ú_StateBindingWrapper.__init__´  s   ø€ ô 	‰Ñ˜Ôà#Õr   c                 ó   • Xl         U $ r   )r=   )r   Úwrapper_factorys     r   rk   Ú_StateBindingWrapper.__call__¼  s   € ð +Ôàˆr   c                 óv   ^^^• Tc  U $ U R                   R                  TU5      mU R                  mUUU4S jnU$ )Nc                 ó<   >• T" U 5      nUR                  TT5        U$ r   )Ú__self_setattr__)Úfuncr}   r’   r™   rž   s     €€€r   Ú_bindÚ+_StateBindingWrapper.__get__.<locals>._bindÓ  s$   ø€ Ù% dÓ+ˆGð
 ×$Ñ$ T¨8Ô4àˆNr   )r=   r‘   r›   )r   r’   Úownerr¤   r™   rž   s    `  @@r   r‘   Ú_StateBindingWrapper.__get__Ä  sA   ú€ ð
 ÑØˆKð
 ×*Ñ*×2Ñ2°8¸UÓCˆà×#Ñ#ˆ÷	ð ˆr   )r=   r›   )
r,   r-   r.   r/   Ú__doc__r   rk   r‘   r1   r2   r3   s   @r   r—   r—   ¦  s&   ø† ñð  '÷ $ð $ò÷ð r   r—   r   )r¨   Ú	functoolsr   Úinspectr   r   Ú	__wrapt__r   r   r	   r
   Ú	argumentsr   r   r5   rJ   rT   rf   rn   Úadapter_factoryr•   r—   Úbind_state_to_wrapperrR   r   r   Ú<module>r¯      s›   ðñõ
 ß &÷ó õ %ô3Ð.ô 3ô<-Ð 3ô -ô8
:Ð#7ô 
:ô2˜oô 2÷<$ñ $ô
%˜~ô %ð +€ðDQ¨$¸ÀOö DQôb7˜?ô 7ðt -Ñ r   