§
    ñyIfö  ã                  óî   — U d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	 ddl
mZ ddlmZmZ ddlmZ dd	lmZmZmZ  e¦   «         Zd
ed<    e¦   «         Zded<    e	de¬¦  «        Zdd„Zdd„Z	 dd d„ZdS )!z,Transform utilities (filters and decorator).é    )Úannotations)ÚOrderedDict)Ú	Generator)ÚAnyÚTypeVar)ÚInferenceContext)ÚInferenceOverwriteErrorÚUseInferenceDefault)ÚNodeNG)ÚInferenceResultÚInferFnÚTransformFnzXOrderedDict[tuple[InferFn[Any], NodeNG, InferenceContext | None], list[InferenceResult]]Ú_cachez set[tuple[InferFn[Any], NodeNG]]Ú_CURRENTLY_INFERRINGÚ_NodesT)ÚboundÚreturnÚNonec                 ó8   — t                                ¦   «          dS )zClear the inference tips cache.N)r   Úclear© ó    úI/var/www/piapp/venv/lib/python3.11/site-packages/astroid/inference_tip.pyÚclear_inference_tip_cacher      s   € å
‡L‚L�N„N€N€N€Nr   ÚfuncúInferFn[_NodesT]c                ó   ‡ — 	 ddˆ fd
„}|S )z(Cache decorator used for inference tips.NÚnoder   ÚcontextúInferenceContext | NoneÚkwargsr   r   ú&Generator[InferenceResult, None, None]c              ;  ó2  •K  — ‰| f}|t           v r!t                                |¦  «         t          ‚|�|                     ¦   «         rd }	 t          ‰| |f         E d {V —† d S # t
          $ �r t                                |¦  «         	 t           ‰| |fi |¤Ž¦  «        x}t          ‰| |f<   n# t          $ r}|d ‚d }~ww xY w	 	 t                                |¦  «         n# t
          $ r Y nw xY wt          t          ¦  «        dk    rt           
                    d¬¦  «         ne# 	 t                                |¦  «         n# t
          $ r Y nw xY wt          t          ¦  «        dk    rt           
                    d¬¦  «         w w xY wY nw xY w|E d {V —† d S )Né@   F)Úlast)r   Úremover
   Úis_emptyr   ÚKeyErrorÚaddÚlistÚ	ExceptionÚlenÚpopitem)r   r   r!   Úpartial_cache_keyÚresultÚer   s         €r   Úinnerz$_inference_tip_cached.<locals>.inner'   s  øè è € ð
 " 4˜LÐØÕ 4Ð4Ð4õ !×'Ò'Ð(9Ñ:Ô:Ð:Ý%Ð%ØÐ 7×#3Ò#3Ñ#5Ô#5ÐàˆGð	/Ý˜d D¨'Ð1Ô2Ð2Ð2Ð2Ð2Ð2Ð2Ð2ØˆFøÝð 	/ñ 	/ð 	/õ !×$Ò$Ð%6Ñ7Ô7Ð7ð/å7;Ø�D˜˜wÐ1Ð1¨&Ð1Ð1ñ8ô 8ð ��  d¨GÐ 3Ñ4Ð4øõ ð "ð "ð "à˜TÐ!øøøøð"øøøð 5ðÝ(×/Ò/Ð0AÑBÔBÐBÐBøÝð ð ð Ø�Dðøøøõ •v‘;”; Ò#Ð#Ý—N’N¨�NÑ.Ô.Ð.øøðÝ(×/Ò/Ð0AÑBÔBÐBÐBøÝð ð ð Ø�Dðøøøõ •v‘;”; Ò#Ð#Ý—N’N¨�NÑ.Ô.Ð.Ð.ð $øøøøøð-	/øøøð4 ÐÐÐÐÐÐÐÐÐsŠ   ÁA# Á#%FÂ	$B.Â-D$Â.
C Â8B;Â;C Ã D$ÃC ÃFÃ 
C-Ã*FÃ,C-Ã-7FÄ$FÄ&EÅ FÅ
E	ÅFÅE	Å8FÆFÆF)N)r   r   r   r    r!   r   r   r"   r   )r   r1   s   ` r   Ú_inference_tip_cachedr2   $   s3   ø€ ð
 ,0ð+ð +ð +ð +ð +ð +ð +ðZ €Lr   FÚinfer_functionÚraise_on_overwriteÚboolúTransformFn[_NodesT]c                ó   ‡— | fdˆfd„}|S )a¥  Given an instance specific inference function, return a function to be
    given to AstroidManager().register_transform to set this inference function.

    :param bool raise_on_overwrite: Raise an `InferenceOverwriteError`
        if the inference tip will overwrite another. Used for debugging

    Typical usage

    .. sourcecode:: python

       AstroidManager().register_transform(Call, inference_tip(infer_named_tuple),
                                  predicate)

    .. Note::

        Using an inference tip will override
        any previously set inference tip for the given
        node. Use a predicate in the transform to prevent
        excess overwrites.
    r   r   r3   r   r   c                ó¨   •— ‰r:| j         �3| j         |ur*t          d                     || j         | ¬¦  «        ¦  «        ‚t          |¦  «        | _         | S )NzbInference already set to {existing_inference}. Trying to overwrite with {new_inference} for {node})Úexisting_inferenceÚnew_inferencer   )Ú_explicit_inferencer	   Úformatr2   )r   r3   r4   s     €r   Ú	transformz inference_tip.<locals>.transformo   sw   ø€ ð ð	àÔ(Ð4ØÔ(°Ð>Ð>å)ðFßFLÂfØ'5Ø"&Ô":Øð GMñ Gô Gñô ð õ $9¸Ñ#HÔ#HˆÔ Øˆr   )r   r   r3   r   r   r   r   )r3   r4   r=   s    ` r   Úinference_tipr>   W   s4   ø€ ð2 ;Iðð ð ð ð ð ð ð& Ðr   N)r   r   )r   r   r   r   )F)r3   r   r4   r5   r   r6   )Ú__doc__Ú
__future__r   Úcollectionsr   Úcollections.abcr   Útypingr   r   Úastroid.contextr   Úastroid.exceptionsr	   r
   Úastroid.nodesr   Úastroid.typingr   r   r   r   Ú__annotations__Úsetr   r   r   r2   r>   r   r   r   ú<module>rJ      sq  ðð
 3Ð 2Ð 2à "Ð "Ð "Ð "Ð "Ð "à #Ð #Ð #Ð #Ð #Ð #Ø %Ð %Ð %Ð %Ð %Ð %Ø Ð Ð Ð Ð Ð Ð Ð à ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø KÐ KÐ KÐ KÐ KÐ KÐ KÐ KØ  Ð  Ð  Ð  Ð  Ð  ðð ð ð ð ð ð ð ð ð ð €K�M„Mð ð ð ð ñ ð :=¸¹¼Ð Ð >Ð >Ð >Ñ >à
ˆ'�) 6Ð
*Ñ
*Ô
*€ðð ð ð ð
0ð 0ð 0ð 0ðh BGð+ð +ð +ð +ð +ð +ð +r   