§
    ñyIfŽ!  ã                  óF  — d Z ddlmZ ddlZddlZddlZddlZddlmZm	Z	 ddl
mZ ddlmZ ddlmZ ddlmZ dd	lmZ ej        d
k    rddl
mZ nddlmZ  ed¦  «        Z ed¦  «        Zd„ Zdd„Zdd„Z ej        ¦   «         r	 ddd„Z	 ddd„ZdS 	 ddd„Z	 ddd„ZdS ) z(A few useful function/method decorators.é    )ÚannotationsN)ÚCallableÚ	Generator)ÚTypeVar)Úutil)ÚInferenceContext)ÚInferenceError)ÚInferenceResult)é   é
   )Ú	ParamSpecÚ_RÚ_Pc                óH   — t          j        | ¦  «        d| fdd„¦   «         }|S )zÄReturn the given infer function wrapped to handle the path.

    Used to stop inference if the node has already been looked
    at for a given `InferenceContext` to prevent infinite recursion
    NÚcontextúInferenceContext | NoneÚreturnr   c              ;  óü   K  — |€t          ¦   «         }|                     | ¦  «        rdS t          ¦   «         } || |fi |¤ŽD ]9}|j        j        dk    r|j        }n|}||vr|V — |                     |¦  «         Œ:dS )z"Wrapper function handling context.NÚInstance)r   ÚpushÚsetÚ	__class__Ú__name__Ú_proxiedÚadd)Únoder   Ú_funcÚkwargsÚyieldedÚresÚaress          úF/var/www/piapp/venv/lib/python3.11/site-packages/astroid/decorators.pyÚwrappedzpath_wrapper.<locals>.wrapped%   s¬   è è € ð
 ˆ?Ý&Ñ(Ô(ˆGØ�<Š<˜ÑÔð 	ØˆFå‘%”%ˆà�5˜˜wÐ1Ð1¨&Ð1Ð1ð 	"ð 	"ˆCàŒ}Ô%¨Ò3Ð3Ø”|��à�Ø˜7Ð"Ð"Ø�	�	�	Ø—’˜DÑ!Ô!Ð!øð	"ð 	"ó    )r   r   r   r   ©Ú	functoolsÚwraps)Úfuncr#   s     r"   Úpath_wrapperr)      s>   € õ „_�TÑÔà15¸Tð"ð "ð "ð "ñ Ôð"ð* €Nr$   r(   ú4Callable[_P, Generator[InferenceResult, None, None]]r   c                ó   ‡ — dˆ fd„}|S )	NÚargsú_P.argsr   ú	_P.kwargsr   ú&Generator[InferenceResult, None, None]c               ?  ó�   •K  —  ‰| i |¤Ž}	 t          |¦  «        V — n# t          $ r t          j        V — Y d S w xY w|E d {V —† d S )N)ÚnextÚStopIterationr   ÚUninferable)r,   r   Ú	generatorr(   s      €r"   Úinnerz&yes_if_nothing_inferred.<locals>.innerA   sˆ   øè è € ð �D˜$Ð) &Ð)Ð)ˆ	ð	Ý�y‘/”/Ð!Ð!Ð!Ð!øÝð 	ð 	ð 	åÔ"Ð"Ð"Ð"ØˆFˆFð	øøøð
 ÐÐÐÐÐÐÐÐÐs   � Ÿ;º;©r,   r-   r   r.   r   r/   © ©r(   r5   s   ` r"   Úyes_if_nothing_inferredr9   >   s(   ø€ ðð ð ð ð ð ð €Lr$   c                ó   ‡ — dˆ fd„}|S )	Nr,   r-   r   r.   r   r/   c               ?  ó8  •K  —  ‰| i |¤Ž}	 t          |¦  «        V — ns# t          $ r4}|j        rt          di |j        d         ¤Ž|‚t          d¦  «        |‚d }~wt          $ r*}t          dt          j        ¦   «         › d�¦  «        |‚d }~ww xY w|E d {V —† d S )Nr   z3StopIteration raised without any error information.z!RecursionError raised with limit ú.r7   )r1   r2   r,   r	   ÚRecursionErrorÚsysÚgetrecursionlimit)r,   r   r4   Úerrorr(   s       €r"   r5   z(raise_if_nothing_inferred.<locals>.innerU   sù   øè è € ð �D˜$Ð) &Ð)Ð)ˆ	ð	Ý�y‘/”/Ð!Ð!Ð!Ð!øÝð 	ð 	ð 	àŒzð AÝ$Ð5Ð5 u¤z°!¤}Ð5Ð5¸5Ð@Ý ØEñô àðøøøøõ ð 	ð 	ð 	Ý ØNµCÔ4IÑ4KÔ4KÐNÐNÐNñô àðøøøøð	øøøð
 ÐÐÐÐÐÐÐÐÐs    � Ÿ
B©/AÁBÁ%%B
Â
Br6   r7   r8   s   ` r"   Úraise_if_nothing_inferredrA   R   s(   ø€ ðð ð ð ð ð ð( €Lr$   ú3.0Úastroid_versionÚstrÚ	argumentsú.Callable[[Callable[_P, _R]], Callable[_P, _R]]c                ó   ‡ ‡— dˆˆ fd„}|S )a›  Decorator which emits a DeprecationWarning if any arguments specified
        are None or not passed at all.

        Arguments should be a key-value mapping, with the key being the argument to check
        and the value being a type annotation as string for the value of the argument.

        To improve performance, only used when DeprecationWarnings other than
        the default one are enabled.
        r(   úCallable[_P, _R]r   c                óN   •‡ — t          j        ‰ ¦  «        dˆˆˆ fd„¦   «         }|S )	úDecorator function.r,   r-   r   r.   r   r   c                 ó`  •— t          t          j        ‰¦  «        j                             ¦   «         ¦  «        }‰                     ¦   «         D ]Ù\  }}	 |                     |¦  «        }n5# t          $ r( t          d|› d| d         j        j	        › d�¦  «        d‚w xY w||v r||         �8||vrx|dk    s.t          | ¦  «        |k    st          | ¦  «        |k    rL| |         €Dt          j        d|› d| d         j        j	        › d‰j        › d	‰› d
|› d|› d�t          d¬¦  «         ŒÚ ‰| i |¤ŽS )z/Emit DeprecationWarnings if conditions are met.úCan't find argument 'ú' for 'r   ú'Néÿÿÿÿz#' will be a required argument for 'r<   z' in astroid z ('z' should be of type: 'z')é   ©Ú
stacklevel©ÚlistÚinspectÚ	signatureÚ
parametersÚkeysÚitemsÚindexÚ
ValueErrorr   Ú__qualname__ÚlenÚwarningsÚwarnr   ÚDeprecationWarning)	r,   r   rX   ÚargÚtype_annotationrZ   rE   rC   r(   s	         €€€r"   Úwrapperz@deprecate_default_argument_values.<locals>.deco.<locals>.wrapper„   s¶  ø€ õ �GÔ-¨dÑ3Ô3Ô>×CÒCÑEÔEÑFÔF�Ø,5¯OªOÑ,=Ô,=ð ð Ñ(�C˜ð$Ø $§
¢
¨3¡¤˜˜øÝ%ð $ð $ð $Ý(Øa°CÐaÐaÀÀQÄÔ@QÔ@^ÐaÐaÐañô à#ð$ð$øøøð  ˜˜¨6°#¬;Ð+>ð  fÐ,Ð,à! RšK˜KÝ" 4™yœy¨EÒ1Ð1Ý # D¡	¤	¨EÒ 1Ð 1°d¸5´kÐ6Iõ !œðP ð Pð PØ $ Q¤Ô 1Ô >ðPð PØAEÄðPð Pà+:ðPð Pð "%ðPð Pð =LðPð Pð Põ /Ø'(ðñ ô ð øð �t˜TÐ, VÐ,Ð,Ð,ó   ÁA*Á*2B©r,   r-   r   r.   r   r   r%   ©r(   rc   rE   rC   s   ` €€r"   Údecoz/deprecate_default_argument_values.<locals>.deco�   sK   øø€ õ Œ_˜TÑ"Ô"ð#-ð #-ð #-ð #-ð #-ð #-ð #-ñ #Ô"ð#-ðJ ˆNr$   ©r(   rH   r   rH   r7   ©rC   rE   rg   s   `` r"   Ú!deprecate_default_argument_valuesrj   q   s/   øø€ ð )	ð )	ð )	ð )	ð )	ð )	ð )	ðV ˆr$   c                ó   ‡ ‡— dˆˆ fd„}|S )a�  Decorator which emits a DeprecationWarning if any arguments specified
        are passed.

        Arguments should be a key-value mapping, with the key being the argument to check
        and the value being a string that explains what to do instead of passing the argument.

        To improve performance, only used when DeprecationWarnings other than
        the default one are enabled.
        r(   rH   r   c                óN   •‡ — t          j        ‰ ¦  «        dˆˆˆ fd„¦   «         }|S )	Nr,   r-   r   r.   r   r   c                 ó   •— t          t          j        ‰¦  «        j                             ¦   «         ¦  «        }‰                     ¦   «         D ]©\  }}	 |                     |¦  «        }n5# t          $ r( t          d|› d| d         j        j	        › d�¦  «        d ‚w xY w||v st          | ¦  «        |k    rAt          j        d|› d| d         j        j	        › d‰j        › d‰› d|› d	�t          d
¬¦  «         Œª ‰| i |¤ŽS )NrL   rM   r   rN   zThe argument 'r<   z/' is deprecated and will be removed in astroid z (ú)rP   rQ   rS   )	r,   r   rX   ra   ÚnoterZ   rE   rC   r(   s	         €€€r"   rc   z2deprecate_arguments.<locals>.deco.<locals>.wrapper¼   sc  ø€ å�GÔ-¨dÑ3Ô3Ô>×CÒCÑEÔEÑFÔF�Ø!*§¢Ñ!2Ô!2ð ð ‘I�C˜ð$Ø $§
¢
¨3¡¤˜˜øÝ%ð $ð $ð $Ý(Øa°CÐaÐaÀÀQÄÔ@QÔ@^ÐaÐaÐañô à#ð$ð$øøøð ˜f�}�}­¨D©	¬	°EÒ(9Ð(9Ý œðY¨Sð Yð YØ $ Q¤Ô 1Ô >ðYð YØAEÄðYð Yà>MðYð YàQUðYð Yð Yõ /Ø'(ðñ ô ð øð �t˜TÐ, VÐ,Ð,Ð,rd   re   r%   rf   s   ` €€r"   rg   z!deprecate_arguments.<locals>.deco»   sH   øø€ ÝŒ_˜TÑ"Ô"ð-ð -ð -ð -ð -ð -ð -ñ #Ô"ð-ð& ˆNr$   rh   r7   ri   s   `` r"   Údeprecate_argumentsrp   ®   s.   øø€ ð	ð 	ð 	ð 	ð 	ð 	ð 	ð. ˆr$   c                ó   — dd„}|S )úbPassthrough decorator to improve performance if DeprecationWarnings are
        disabled.
        r(   rH   r   c                ó   — | S ©rJ   r7   ©r(   s    r"   rg   z/deprecate_default_argument_values.<locals>.decoÝ   ó   € àˆKr$   rh   r7   ri   s      r"   rj   rj   Ö   ó   € ð	ð 	ð 	ð 	ð ˆr$   c                ó   — dd„}|S )rr   r(   rH   r   c                ó   — | S rt   r7   ru   s    r"   rg   z!deprecate_arguments.<locals>.decoê   rv   r$   rh   r7   ri   s      r"   rp   rp   ã   rw   r$   )r(   r*   r   r*   )rB   )rC   rD   rE   rD   r   rF   )Ú__doc__Ú
__future__r   r&   rU   r>   r^   Úcollections.abcr   r   Útypingr   Úastroidr   Úastroid.contextr   Úastroid.exceptionsr	   Úastroid.typingr
   Úversion_infor   Útyping_extensionsr   r   r)   r9   rA   Úcheck_warnings_filterrj   rp   r7   r$   r"   ú<module>r…      sã  ðð
 /Ð .à "Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ø €€€Ø 
€
€
€
Ø €€€Ø /Ð /Ð /Ð /Ð /Ð /Ð /Ð /Ø Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø -Ð -Ð -Ð -Ð -Ð -Ø *Ð *Ð *Ð *Ð *Ð *àÔ�wÒÐØ Ð Ð Ð Ð Ð Ð à+Ð+Ð+Ð+Ð+Ð+à€WˆT�]„]€Ø€Yˆt�_„_€ðð ð ð@ð ð ð ð(ð ð ð ð: €4ÔÑÔð ð  %ð;ð ;ð ;ð ;ð ;ð|  %ð$ð $ð $ð $ð $ð $ð $ðR  %ðð ð ð ð ð  %ðð ð ð ð ð ð r$   