+
    eZ                        a  R t0 t R t^ RIt^ RIHt ^ RIHtHtHt ^ RI	H
t
 ^ RIHt / s] ^ k RR R lltR tR	 tR
 tR# )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_cachec                (    V ^8  d   QhR\         RR/# )   
delete_allreturnN)bool)formats   ",/usr/lib/python3/dist-packages/jedi/cache.py__annotate__r      s        $  4      c                V   V '       dC   \         P                  4        F  pVP                  4        K  	  \        P                  ! 4        R# \         P                  4        FF  p\	        VP                  4       4       F&  w  pw  rEV\        P                  ! 4       8  g   K$  W# K(  	  KH  	  R# )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)_time_cachesvaluesclearr   listitemstime)r   cachetckeytvalues   &     r   clear_time_cachesr      sq     !((*EKKM + %%'B#'
#3Zatyy{? $4 (r   c                   a  V 3R lpV# )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   <a a / oS\         S&   VV V3R  lpV# )c                  "  < S! V / VB p\        V4      p SV,          w  rEV\        P                  ! 4       8  d   V#  \        V4      p\        \        S	4      pVe"   \        P                  ! 4       V,           V3SV&   V#   \         d     LOi ; i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   &B   BB)r   )r,   r.   r+   r-   s   f @r   _temp#signature_time_cache.<locals>._temp8   s    ),%&	 r    )r-   r0   s   f r   signature_time_cacher3   /   s    ( Lr   c                    a  V 3R  lpV# )c                 R   <a a / o\        S 4      VV V3R  l4       pV3R lVn        V# )c                    < V \        VP                  4       4      3p SV,          w  r4\        P                  ! 4       VS,           8  d   V#  S! V / VB p\        P                  ! 4       V3SV&   V#   \         d     L1i ; i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   -A1 1A?>A?c                  $   < S P                  4       # r"   )r   )r   s   r   <lambda>/time_cache.<locals>.decorator.<locals>.<lambda>`   s    ekkmr   )r   clear_cache)r:   r.   r   r;   s   f @r   	decoratortime_cache.<locals>.decoratorP   s-    	t
	 

	 4r   r2   )r;   rA   s   f r   
time_cacherC   O   s    & r   c                0   a  \        S 4      V 3R l4       pV# )zA normal memoize function.c                    < V P                   P                  R / 4      pVP                  S/ 4      pV\        VP                  4       4      3p WE,          #   \         d    S! T .TO5/ TB pYdT&   Tu # i ; i)_memoize_method_dct)__dict__
setdefaultr7   r   r$   )selfr&   r'   
cache_dictr+   r   r9   methods   &*,    r   r.   memoize_method.<locals>.wrapperh   s|    ]]--.CRH
##FB/Yv||~./	8O 	D24262FHM	s   A A43A4r   )rK   r.   s   f r   memoize_methodrM   f   s     
6]	 	 Nr   c                    V ^8  d   Qh/ ^ \         9   d=   \        \        \        \        \        \
        \        3,          3,          3,          ;R&   # )r
   r   )__conditional_annotations__r   strr   r   float)r   s   "r   r   r      s;      ( ; :d3S%s
"33445 :)r   )F)rO   __doc__r   	functoolsr   typingr   r   r   jedir   parso.cacher   r   r   r3   rC   rM   r   )rO   s   @r   <module>rW      s<      # #  $8: : .@.r   