Ë
    §ŒjN!  ã                   óò   — d Z ddlmZmZmZmZ ddlmZ ddlm	Z	m
Z
mZmZ  e«       Zd„ Zd„ Zd„ Zd	„ Zd
„ Z G d„ de	«      Z G d„ d«      Z G d„ dee«      Z G d„ de
«      Z G d„ dee«      Zdddddœd„Zy)a   The `with_signature` decorator: override the signature (and related
introspection attributes) of a wrapped callable without mutating the wrapped
function itself. Accepts a prototype callable, a prebuilt `inspect.Signature`,
or a factory that derives a signature from the wrapped function at decoration
time.

This replaces the need for the `adapter=` argument of `wrapt.decorator`,
which is planned for deprecation.
é    )Ú
CO_VARARGSÚCO_VARKEYWORDSÚ	ParameterÚ	Signature)Ú	signatureé   )ÚBaseObjectProxyÚBoundFunctionWrapperÚCallableObjectProxyÚFunctionWrapperc                 óP   ‡ ‡— d‰ j                  d«      › �Šˆ ˆfd„}t        |«      S )aQ  Read-only property that memoizes its derivation in a `_self_*` slot.

    `functools.cached_property` is unusable on ObjectProxy subclasses: wrapt
    overrides `__dict__` with a property returning the wrapped object's dict,
    so cached_property's `instance.__dict__[name] = value` would mutate the
    wrapped function. Storing under a `_self_*` name routes through wrapt's
    own setattr handling and lands in the proxy's real instance dict. Using
    a `@property` (data descriptor) also ensures we win over any value
    copied into the instance dict by `FunctionWrapper.__init__`.
    Ú_self_cached_Ú_c                 ó€   •— t        | ‰t        «      }|t        u r#| j                  ‰«      }| j                  ‰|«       |S ©N)ÚgetattrÚ_MISSINGÚ_deriveÚ__self_setattr__)ÚselfÚvalueÚattrÚslots     €€úY/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/wrapt/signature.pyÚgetterz_cached.<locals>.getter%   s<   ø€ Ü˜˜d¤HÓ-ˆØ”HÑØ—L‘L Ó&ˆEØ×!Ñ! $¨Ô.Øˆó    )ÚlstripÚproperty)r   r   r   s   ` @r   Ú_cachedr      s-   ù€ ð ˜4Ÿ;™; sÓ+Ð,Ð-€Dõô �FÓÐr   c                 ó  — | j                   j                  «       D �ci c]5  }|j                  t        j                  ur|j
                  |j                  “Œ7 }}| j                  t        j                  ur| j                  |d<   |S c c}w )NÚreturn)Ú
parametersÚvaluesÚ
annotationr   ÚemptyÚnameÚreturn_annotationr   )ÚsigÚpÚanns      r   Ú_derive_annotationsr+   /   s{   € ð —‘×&Ñ&Ô(óá(ˆAØ�<‰<œyŸ™Ñ.ð 	
�‰�—‘ÑØ(ð ð ð
 ×Ñ¤I§O¡OÑ3Ø×-Ñ-ˆˆH‰Ø€Jùòs   �:Bc                 ób   — t        d„ | j                  j                  «       D «       «      }|xs d S )Nc              3   óÄ   K  — | ]X  }|j                   t        j                  t        j                  fv r*|j                  t        j
                  ur|j                  –— ŒZ y ­wr   )Úkindr   ÚPOSITIONAL_ONLYÚPOSITIONAL_OR_KEYWORDÚdefaultr%   ©Ú.0r)   s     r   Ú	<genexpr>z#_derive_defaults.<locals>.<genexpr>;   sI   è ø€ ð á(ˆAØ�6‰6”i×/Ñ/´×1PÑ1PÐQÑQØ�I‰IœYŸ_™_Ñ,ð 	
�	�	Ù(ùs   ‚AA )Útupler"   r#   )r(   Údefaultss     r   Ú_derive_defaultsr7   :   s3   € Üñ à—‘×&Ñ&Ô(óó €Hð Ò�tÐr   c                 ó   — | j                   j                  «       D �ci c]Q  }|j                  t        j                  u r3|j
                  t        j                  ur|j                  |j
                  “ŒS }}|xs d S c c}w r   )r"   r#   r.   r   ÚKEYWORD_ONLYr1   r%   r&   )r(   r)   Ú
kwdefaultss      r   Ú_derive_kwdefaultsr;   D   sq   € ð —‘×&Ñ&Ô(óá(ˆAØ�6‰6”Y×+Ñ+Ñ+°·	±	ÄÇÁÑ0Pð 	
�‰�—	‘	ÑØ(ð ð ð
 Ò˜Ðùòs   �AA;c                 óº  — g g g }}}d x}}| j                   j                  «       D ]ü  }|j                  t        j                  u r|j                  |j                  «       Œ;|j                  t        j                  u r|j                  |j                  «       Œs|j                  t        j                  u r|j                  }Œœ|j                  t        j                  u r|j                  |j                  «       ŒÔ|j                  t        j                  u sŒñ|j                  }Œþ ||z   |z   }|r|j                  |«       |r|j                  |«       t        |«      S r   )r"   r#   r.   r   r/   Úappendr&   r0   ÚVAR_POSITIONALr9   ÚVAR_KEYWORDr5   )r(   Úpos_onlyÚ	pos_or_kwÚkw_onlyÚvar_posÚvar_kwr)   Únamess           r   Ú_derive_varnamesrF   M   s  € Ø#% r¨2˜ˆi€HØÐ€GˆfØ�^‰^×"Ñ"Ö$ˆØ�6‰6”Y×.Ñ.Ñ.Ø�O‰O˜AŸF™FÕ#Ø�V‰V”y×6Ñ6Ñ6Ø×Ñ˜QŸV™VÕ$Ø�V‰V”y×/Ñ/Ñ/Ø—f‘f‰GØ�V‰V”y×-Ñ-Ñ-Ø�N‰N˜1Ÿ6™6Õ"Ø�V‰V”y×,Ñ,Ò,Ø—V‘V‰Fð %ð �yÑ  7Ñ*€EÙØ�‰�WÔÙØ�‰�VÔÜ�‹<Ðr   c                   óx   ‡ — e Zd ZdZˆ fd„Zd„ Z ed«      Z ed«      Z ed«      Z	 ed«      Z
 ed«      Zˆ xZS )	Ú_SignatureCodezÔCode-object proxy deriving argument-related co_* attrs from a Signature.

    Non-argument bits (co_flags for coroutine/generator, co_filename, etc.)
    fall through to the wrapped function's real __code__.
    c                 ó2   •— t         ‰| �  |«       || _        y r   ©ÚsuperÚ__init__Ú_self_signature©r   Úwrappedr   Ú	__class__s      €r   rL   z_SignatureCode.__init__j   ó   ø€ Ü‰Ñ˜Ô!Ø(ˆÕr   c                 óâ  ‡— | j                   }|dk(  rLt        j                  t        j                  fŠt	        ˆfd„|j
                  j                  «       D «       «      S |dk(  r*t	        d„ |j
                  j                  «       D «       «      S |dk(  r*t	        d„ |j
                  j                  «       D «       «      S |dk(  rt        |«      S |dk(  r�|j
                  j                  «       D �ch c]  }|j                  ’Œ c}Š| j                  j                  t        t        z   z  }t        j                  ‰v r	|t        z  }t        j                  ‰v r	|t        z  }|S t        |«      ‚c c}w )	NÚco_argcountc              3   ó:   •K  — | ]  }|j                   ‰v –— Œ y ­wr   )r.   )r3   r)   Úkindss     €r   r4   z)_SignatureCode._derive.<locals>.<genexpr>r   s   øè ø€ ÐHÑ0G¨1�q—v‘v ”Ñ0Gùs   ƒÚco_posonlyargcountc              3   óT   K  — | ]   }|j                   t        j                  u –— Œ" y ­wr   )r.   r   r/   r2   s     r   r4   z)_SignatureCode._derive.<locals>.<genexpr>t   s$   è ø€ ð Ù=T¸�—‘œ)×3Ñ3Ô3Ñ=Tùó   ‚&(Úco_kwonlyargcountc              3   óT   K  — | ]   }|j                   t        j                  u –— Œ" y ­wr   )r.   r   r9   r2   s     r   r4   z)_SignatureCode._derive.<locals>.<genexpr>x   s$   è ø€ ð Ù:Q°Q�—‘œ)×0Ñ0Ô0Ñ:QùrX   Úco_varnamesÚco_flags)rM   r   r/   r0   Úsumr"   r#   rF   r.   Ú__wrapped__r\   r   r   r>   r?   ÚAttributeError)r   r   r(   r)   ÚflagsrU   s        @r   r   z_SignatureCode._deriven   sS  ø€ Ø×"Ñ"ˆØ�=Ò Ü×.Ñ.´	×0OÑ0OÐPˆEÜÓH°·±×0EÑ0EÔ0GÓHÓHÐHØÐ'Ò'Üñ Ø=@¿^¹^×=RÑ=RÔ=Tóó ð ð Ð&Ò&Üñ Ø:=¿.¹.×:OÑ:OÔ:Qóó ð ð �=Ò Ü# CÓ(Ð(Ø�:ÒØ%(§^¡^×%:Ñ%:Ô%<Ó=Ñ%< �Q—V“VÐ%<Ñ=ˆEØ×$Ñ$×-Ñ-´*¼~Ñ2MÐ0NÑNˆEÜ×'Ñ'¨5Ñ0ØœÑ#�Ü×$Ñ$¨Ñ-ØœÑ'�ØˆLÜ˜TÓ"Ð"ùò >s   Ã.E,rS   rV   rY   r[   r\   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__rL   r   r   rS   rV   rY   r[   r\   Ú__classcell__©rP   s   @r   rH   rH   c   sJ   ø„ ñô)ò#ñ2 ˜-Ó(€KÙ Ð!5Ó6ÐÙÐ 3Ó4ÐÙ˜-Ó(€KÙ�zÓ"„Hr   rH   c                   óf   — e Zd ZdZd„ Zed„ «       Z ed«      Z ed«      Z	 ed«      Z
 ed«      Zy)	Ú_SignatureMixinzEShared Signature-derived introspection attrs for wrapper + surrogate.c                 óÚ   — | j                   }|dk(  rt        |«      S |dk(  rt        |«      S |dk(  rt        |«      S |dk(  r t	        | j
                  j                  |«      S t        |«      ‚)NÚ__annotations__Ú__defaults__Ú__kwdefaults__Ú__code__)rM   r+   r7   r;   rH   r^   rm   r_   )r   r   r(   s      r   r   z_SignatureMixin._derive‘   st   € Ø×"Ñ"ˆØÐ$Ò$Ü& sÓ+Ð+Ø�>Ò!Ü# CÓ(Ð(ØÐ#Ò#Ü% cÓ*Ð*Ø�:ÒÜ! $×"2Ñ"2×";Ñ";¸SÓAÐAÜ˜TÓ"Ð"r   c                 ó   — | j                   S r   )rM   ©r   s    r   Ú__signature__z_SignatureMixin.__signature__�   s   € à×#Ñ#Ð#r   rj   rk   rl   rm   N)ra   rb   rc   rd   r   r   rp   r   rj   rk   rl   rm   © r   r   rh   rh   Ž   sJ   „ ÙOò
#ð ñ$ó ð$ñ Ð/Ó0€OÙ˜>Ó*€LÙÐ-Ó.€NÙ�zÓ"�Hr   rh   c                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )Ú_SignatureFunctionSurrogatea  Function surrogate exposing Signature-derived introspection attrs.

    Used as __func__ of a bound wrapper so that inspect.signature -- which
    treats the bound wrapper as a MethodType and consults __func__ -- sees
    our override and strips self/cls correctly.
    c                 ó2   •— t         ‰| �  |«       || _        y r   rJ   rN   s      €r   rL   z$_SignatureFunctionSurrogate.__init__¯   rQ   r   )ra   rb   rc   rd   rL   re   rf   s   @r   rs   rs   §   s   ø„ ñ÷)ð )r   rs   c                   ó,   — e Zd Zed„ «       Zed„ «       Zy)Ú_BoundSignatureFunctionWrapperc                 ój   — t        | j                  j                  | j                  j                  «      S r   )rs   r^   Ú__func__Ú_self_parentrM   ro   s    r   rx   z'_BoundSignatureFunctionWrapper.__func__µ   s,   € ä*Ø×Ñ×%Ñ% t×'8Ñ'8×'HÑ'Hó
ð 	
r   c                 ó.   — | j                   j                  S r   )ry   rM   ro   s    r   rp   z,_BoundSignatureFunctionWrapper.__signature__»   s   € à× Ñ ×0Ñ0Ð0r   N)ra   rb   rc   r   rx   rp   rq   r   r   rv   rv   ´   s(   „ Øñ
ó ð
ð
 ñ1ó ñ1r   rv   c                   ó2   ‡ — e Zd ZeZˆ fd„Zed„ «       Zˆ xZS )Ú_SignatureFunctionWrapperc                 ó4   •— t         ‰| �  ||«       || _        y r   rJ   )r   rO   Úwrapperr   rP   s       €r   rL   z"_SignatureFunctionWrapper.__init__Ã   s   ø€ Ü‰Ñ˜ 'Ô*Ø(ˆÕr   c                 óB   — t        | j                  | j                  «      S r   )rs   r^   rM   ro   s    r   rx   z"_SignatureFunctionWrapper.__func__Ç   s   € ä*¨4×+;Ñ+;¸T×=QÑ=QÓRÐRr   )	ra   rb   rc   rv   Ú__bound_function_wrapper__rL   r   rx   re   rf   s   @r   r|   r|   À   s$   ø„ Ø!?Ðô)ð ñSó ôSr   r|   N)Ú	prototyper   Úfactoryc               ó˜   ‡‡‡— t        d„ ‰‰‰fD «       «      }|dk(  rt        d«      ‚|dkD  rt        d«      ‚ˆˆˆfd„}| €|S  || «      S )a   Override the signature of a wrapped callable.

    Exactly one of `prototype`, `signature`, or `factory` must be supplied:

    - `prototype`: a callable whose signature will be used.
    - `signature`: a prebuilt `inspect.Signature` object.
    - `factory`: a callable `factory(wrapped)` invoked at decoration time
      that returns either a `Signature` or a prototype callable.

    The resulting wrapper exposes the override via `__signature__`, and
    derives `__annotations__`, `__defaults__`, `__kwdefaults__`, and the
    argument-related attributes of `__code__` from the same source. The
    wrapped function is not mutated. Calling behaviour is unchanged.
    c              3   ó$   K  — | ]  }|d u–— Œ
 y ­wr   rq   )r3   Úxs     r   r4   z!with_signature.<locals>.<genexpr>Ü   s   è ø€ ÐKÑ+J a�A˜T”MÑ+Jùs   ‚r   zBwith_signature requires one of prototype=, signature=, or factory=r   zFwith_signature accepts only one of prototype=, signature=, or factory=c                 ó”   •— d„ }‰�‰}n3‰�t        ‰«      }n% ‰| «      }t        |t        «      r|n
t        |«      }t        | ||«      S )Nc                 ó   —  | |i |¤ŽS r   rq   )rO   ÚinstanceÚargsÚkwargss       r   Ú_wrapperz4with_signature.<locals>._decorator.<locals>._wrapperç   s   € Ù˜DÐ+ FÑ+Ð+r   )Ú_inspect_signatureÚ
isinstancer   r|   )rO   r‹   ÚresolvedÚproducedr‚   r�   r   s       €€€r   Ú
_decoratorz"with_signature.<locals>._decoratoræ   s^   ø€ ò	,ð Ð Ø ‰HØÐ"Ü)¨)Ó4‰Há˜wÓ'ˆHô ˜h¬	Ô2ñ ä'¨Ó1ð ô )¨°(¸HÓEÐEr   )r]   Ú	TypeError)rO   r�   r   r‚   Ú	specifiedr�   s    ```  r   Úwith_signaturer“   Ì   sj   ú€ ô  ÑK¨I°yÀ'Ñ+JÓKÓK€IØ�A‚~ÜØPó
ð 	
ð �1‚}ÜØTó
ð 	
öFð$ €ØÐÙ�gÓÐr   r   )rd   Úinspectr   r   r   r   r   rŒ   Ú	__wrapt__r	   r
   r   r   Úobjectr   r   r+   r7   r;   rF   rH   rh   rs   rv   r|   r“   rq   r   r   Ú<module>r—      s•   ðñ÷ EÓ DÝ 3÷ó ñ ‹8€òò.òòòô,(#�_ô (#÷V#ñ #ô2
) /Ð3Fô 
)ô	1Ð%9ô 	1ô	S °ô 	Sð.°ÀÈtõ .r   