+
    i                    D   R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
HtHtHt ^ RIHt ^ RIHt ^ RIHtHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHtHt ^ RIHtH t  Rt! ! R R]PD                  4      t#RR R llt$RR R llt%R R lt&R R lt']! ]'RR7      t(R R lt)R# )z9Astroid hooks for understanding functools library module.)annotations)Iterator)partial)chain)BoundMethod	argumentsnodesobjects)extract_node)InferenceContext)InferenceErrorUseInferenceDefault)inference_tip)objectmodel)AstroidManager)InferenceResultSuccessfulInferenceResult)UninferableBase
safe_inferzfunctools.lru_cachec                  J    ] tR t^tRt]R 4       t]R 4       t]R 4       tRt	R# )LruWrappedModelzSpecial attribute model for functions decorated with functools.lru_cache.

The said decorators patches at decoration time some functions onto
the decorated function.
c                	    V P                   # N)	_instance)selfs   &?/usr/lib/python3/dist-packages/astroid/brain/brain_functools.pyattr___wrapped__ LruWrappedModel.attr___wrapped__!   s    ~~    c                	z   a \        R 4      o ! V3R lR\        4      pV! V P                  V P                  R7      # )zQ
        from functools import _CacheInfo
        _CacheInfo(0, 0, 0, 0)
        c                  .   < ] tR t^,tRR V 3R llltRtR# )=LruWrappedModel.attr_cache_info.<locals>.CacheInfoBoundMethodNc               $    V ^8  d   QhRRRRRR/# )   callerz SuccessfulInferenceResult | NonecontextInferenceContext | NonereturnzIterator[InferenceResult] )formats   "r   __annotate__JLruWrappedModel.attr_cache_info.<locals>.CacheInfoBoundMethod.__annotate__-   s(      8 1 +	r   c              3  	:   <"   \        S4      pVf   Q hVx  R # 5ir   )r   )r   r$   r%   res
cache_infos   &&& r   infer_call_resultOLruWrappedModel.attr_cache_info.<locals>.CacheInfoBoundMethod.infer_call_result-   s!     
 !,&	s   r(   r   )__name__
__module____qualname____firstlineno__r/   __static_attributes__)r.   s   r   CacheInfoBoundMethodr!   ,   s     r   r6   proxybound)r
   r   r   )r   r6   r.   s   & @r   attr_cache_infoLruWrappedModel.attr_cache_info%   s5    ! # 

	; 	 $$..OOr   c                	t    \        R 4      p\        WP                  P                  P	                  4       R7      # )zdef cache_clear(self): passr7   )r
   r   r   parentscope)r   nodes   & r   attr_cache_clear LruWrappedModel.attr_cache_clear8   s+    =>^^-B-B-H-H-JKKr   r(   N)
r1   r2   r3   r4   __doc__propertyr   r:   r@   r5   r(   r   r   r   r      sG       P P$ L Lr   r   Nc                    V ^8  d   QhRRRR/# )r#   r%   r&   r'   Noner(   )r)   s   "r   r*   r*   >   s     6 6(? 64 6r   c                0    \        4       ! V 4      V n        R # r   )r   special_attributes)r?   r%   s   &&r   _transform_lru_cacherH   >   s     ./5Dr   c               $    V ^8  d   QhRRRRRR/# )r#   r?   z
nodes.Callr%   r&   r'   z!Iterator[objects.PartialFunction]r(   )r)   s   "r   r*   r*   H   s$     8% 8%
8%68%&8%r   c           
     >   \         P                  P                  WR 7      p\        VP                  4      pV^8  d   \        R4      hV^8X  d   VP                  '       g   \        R4      hVP                  ^ ,          p \        VP                  VR 7      4      p\        T\        4      '       d   \        R4      h\        T\        P                  4      '       g   \        R4      hTP                  '       g   . pMg\!        TP                  P                  ;'       g    R	TP                  P"                  ;'       g    R	TP                  P$                  ;'       g    R	4      pT Uu0 uF1  p\        T\        P&                  4      '       g   K%  TP(                  kK3  	  p	p\+        TP                  4      T	,
          '       d   \        R4      h\,        P.                  ! TTP(                  TP0                  TP2                  T P4                  R7      pTP7                  TP                  TP8                  TP:                  TP<                  TP>                  TP@                  TPB                  R7       \E        T34      #   \        \        3 d   p\
        ThRp?ii ; iu upi )
)r%   z-functools.partial takes at least one argumentz>functools.partial needs at least to have some filled argumentsNz!Cannot infer the wrapped functionz&The wrapped function is not a functionz,wrapped function received unknown parameters)namelineno
col_offsetr=   )argsbody
decoratorsreturnstype_comment_returnstype_comment_argsdoc_noder(   )#r   CallSite	from_calllenpositional_argumentsr   keyword_argumentsnextinferr   StopIteration
isinstancer   r   FunctionDefrN   r   posonlyargs
kwonlyargs
AssignNamerK   setr	   PartialFunctionrL   rM   r=   postinitrO   rP   rQ   rR   rS   rT   iter)
r?   r%   callnumber_of_positionalpartial_functioninferred_wrapped_functionexcfunction_parametersparamparameter_namess
   &&        r   _functools_partial_inferencern   H   sR    '''>Dt889a!"QRRq )?)?)?!L
 	
 003+$()9)?)?)?)P$Q! +_==!"EFF/1B1BCC!"JKK %))) #%**//552%**66<<"%**55;;
 )(EeU--. 	

(  
 4!!"_44!"PQQ..&++(//,77{{ &++&++,77)116KK3EE*33   !#$$S M* +!s*+"s$    I: '"JJ:JJJc                   V ^8  d   QhRR/# )r#   r'   boolr(   )r)   s   "r   r*   r*      s     	 	4 	r   c                    V P                   '       g   R# V P                   P                   FJ  p\        V\        P                  \        P                  34      '       g   K5  \        VR4      '       g   KI   R# 	  R# )z=Check if the given function node is decorated with lru_cache.F	lru_cacheT)rP   r   r]   	AttributeCall_looks_like_functools_member)r?   	decorators   & r   _looks_like_lru_cacherw      sT    ???__**	)eoouzz%BCC'	;??	 +
 r   c               $    V ^8  d   QhRRRRRR/# )r#   r?   znodes.Attribute | nodes.Callmemberstrr'   rp   r(   )r)   s   "r   r*   r*      s$      
&03	r   c                2   \        V \        P                  4      '       d   V P                  V8H  # \        V P                  \        P
                  4      '       d   V P                  P                  V8H  # \        V P                  \        P                  4      '       d{   V P                  P                  V8H  ;'       dZ    \        V P                  P                  \        P
                  4      ;'       d$    V P                  P                  P                  R8H  # R# )z?Check if the given Call node is the wanted member of functools.	functoolsF)r]   r   rs   attrnamefuncNamerK   expr)r?   ry   s   &&r   ru   ru      s     $((}}&&$))UZZ((yy~~''$))U__--II&( 3 3499>>5::63 3		##{2	

 r   r   )ry   c                    V ^8  d   QhRRRR/# )r#   managerr   r'   rE   r(   )r)   s   "r   r*   r*      s     	 	n 	 	r   c                    V P                  \        P                  \        \        4       V P                  \        P
                  \        \        4      \        4       R # r   )	register_transformr   r^   rH   rw   rt   r   rn   _looks_like_partial)r   s   &r   registerr      sB    /1F 

23r   r   )*rB   
__future__r   collections.abcr   r|   r   	itertoolsr   astroidr   r   r   r	   astroid.builderr
   astroid.contextr   astroid.exceptionsr   r   astroid.inference_tipr   astroid.interpreterr   astroid.managerr   astroid.typingr   r   astroid.utilr   r   	LRU_CACHEFunctionModelr   rH   rn   rw   ru   r   r   r(   r   r   <module>r      sy   
 @ " $   : : ( , B / + * E 4!	!Lk// !LH68%v	" :9M 	r   