
    yhZ                         % S r SSKrSSKJr  SSKJrJrJr  SSKJ	r	  SSK
Jr  0 q\\\\\\\4   4   4   \S'   SS\S	S4S
 jjrS rS rS rg)a7  
This caching is very important for speed and memory optimizations. There's
nothing really spectacular, just some decorators. The following cache types are
available:

- ``time_cache`` can be used to cache something for just a limited time span,
  which can be useful if there's user interaction and the user cannot react
  faster than a certain time.

This module is one of the reasons why |jedi| is not thread-safe. As you can see
there are global variables, which are holding the cache information. Some of
these variables are being cleaned after every API usage.
    Nwraps)AnyDictTuple)settings)parser_cache_time_caches
delete_allreturnc                 N   U (       aA  [         R                  5        H  nUR                  5         M     [        R                  " 5         g[         R                  5        HE  n[	        UR                  5       5       H%  u  nu  pEU[        R                  " 5       :  d  M#  X#	 M'     MG     g)zJedi caches many things, that should be completed after each completion
finishes.

:param delete_all: Deletes also the cache that is normally not deleted,
    like parser cache, which is important for faster parsing.
N)r
   valuesclearr	   listitemstime)r   cachetckeytvalues         bc:\Users\julio\OneDrive\Documentos\Trabajo\IdeasFrscas\Cabanna\env\Lib\site-packages\jedi/cache.pyclear_time_cachesr      sq     !((*EKKM + %%'B#'
#3Zatyy{? $4 (    c                    ^  U 4S jnU$ )aD  
This decorator works as follows: Call it with a setting and after that
use the function with a callable that returns the key.
But: This function is only called if the key is not available. After a
certain amount of time (`time_add_setting`) the cache is invalid.

If the given key is None, the function will not be cached.
c                 2   >^ ^ 0 mT[         T'   UU U4S jnU$ )Nc                    > T" U 0 UD6n[        U5      n TU   u  pEU[        R                  " 5       :  a  U$  [        U5      n[        [        T	5      nUb  [        R                  " 5       U-   U4TU'   U$ ! [         a     NIf = fN)nextr   KeyErrorgetattrr   )
argskwargs	generatorr   expiryr   time_adddctkey_functime_add_settings
          r   wrapper4signature_time_cache.<locals>._temp.<locals>.wrapper<   s     $1&1Iy/C #CDIIK' L (
 OEx)9:H99;158CL  s   !A6 6
BB)r
   )r(   r*   r'   r)   s   ` @r   _temp#signature_time_cache.<locals>._temp8   s    ),%&	 r    )r)   r,   s   ` r   signature_time_cacher/   /   s    ( Lr   c                    ^  U 4S jnU$ )Nc                 R   >^ ^ 0 m[        T 5      UU U4S j5       nU4S jUl        U$ )Nc                     > U [        UR                  5       5      4n TU   u  p4[        R                  " 5       UT-   :  a  U$  T" U 0 UD6n[        R                  " 5       U4TU'   U$ ! [         a     N0f = fr   )	frozensetr   r   r    )r"   r#   r   createdresultr   funcsecondss        r   r*   .time_cache.<locals>.decorator.<locals>.wrapperS   s    6<<>23C"'*99;7!22!M 3 4*6*Ff,E#JM	  s   $A( (
A54A5c                  $   > T R                  5       $ r   )r   )r   s   r   <lambda>/time_cache.<locals>.decorator.<locals>.<lambda>`   s    ekkmr   )r   clear_cache)r6   r*   r   r7   s   ` @r   	decoratortime_cache.<locals>.decoratorP   s-    	t
	 

	 4r   r.   )r7   r=   s   ` r   
time_cacher?   O   s    & r   c                 0   ^  [        T 5      U 4S j5       nU$ )zA normal memoize function.c                    > U R                   R                  S0 5      nUR                  T0 5      nU[        UR                  5       5      4n XE   $ ! [         a    T" U /UQ70 UD6nXdU'   Us $ f = f)N_memoize_method_dct)__dict__
setdefaultr3   r   r    )selfr"   r#   
cache_dictr'   r   r5   methods          r   r*   memoize_method.<locals>.wrapperh   s|    ]]--.CRH
##FB/Yv||~./	8O 	D24262FHM	s   A A/.A/r   )rG   r*   s   ` r   memoize_methodrI   f   s     
6]	 	 Nr   )F)__doc__r   	functoolsr   typingr   r   r   jedir   parso.cacher	   r
   strfloat__annotations__boolr   r/   r?   rI   r.   r   r   <module>rS      sh      # #  $8:d3S%s
"33445 : $  4  .@.r   