ó
    Ð]j†  ã                   óž   • % 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)zÙJedi 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         ÚG/home/mande/repo/quber/.venv/lib/python3.13/site-packages/jedi/cache.pyÚclear_time_cachesr      sq   € ö Ü!×(Ñ(Ö*ˆEØ�K‰KŽMñ +ä×ÒÕô ×%Ñ%Ö'ˆBä#'¨¯©«
Ö#3‘�‘Z�aØ”t—y’y“{•?àšó $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   ÚwrapperÚ4signature_time_cache.<locals>._temp.<locals>.wrapper<   s’   ø€ Ù  $Ð1¨&Ñ1ˆIÜ�y“/ˆCðØ # C¡‘�ØœDŸIšI›KÓ'Ø �Lð (ô
 ˜“OˆEÜœxÐ)9Ó:ˆHØ‰ÜŸ9š9›;¨Ñ1°5Ð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Ð3ˆCðØ"'¨¡*‘�Ü—9’9“; ¨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   ø€  e§k¡k¤mr   )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|   ø€ à—]‘]×-Ñ-Ð.CÀRÓHˆ
Ø×#Ñ# F¨BÓ/ˆØ”Y˜vŸ|™|›~Ó.Ð/ˆð	Ø‘8ˆOøÜó 	Ù˜DÐ2 4Ò2¨6Ñ2ˆFØ�‰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:€ˆd�3˜˜S %¨¨s¨
Ñ"3Ð3Ñ4Ð4Ñ5Ó :ñ  $ð  °4õ  ò.ò@ó.r   