Ë
    ¬;j†  ã                   óš   — U d Z ddlZddlmZ ddlmZmZmZ ddlm	Z	 ddl
mZ i aeeeeeeef   f   f   ed<   dded	dfd
„Zd„ Zd„ Zd„ Zy)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                 ó4  — | r>t         j                  «       D ]  }|j                  «        Œ t        j                  «        yt         j                  «       D ]A  }t	        |j                  «       «      D ]#  \  }\  }}|t        j                  «       k  sŒ!||= Œ% ŒC y)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         ú[/workspace/moltex-experiments/.pixi/envs/default/lib/python3.12/site-packages/jedi/cache.pyÚclear_time_cachesr      su   € ñ Ü!×(Ñ(Ö*ˆEØ�K‰K�Mð +ä×ÑÕô ×%Ñ%Ö'ˆBä#'¨¯©«
Ö#3‘�‘Z�a˜Ø”t—y‘y“{“?à˜3™ñ $4ñ (ó    c                 ó   ‡ — ˆ fd„}|S )a\  
    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                 ó0   •‡ ‡— i Š‰t         ‰<   ˆˆ ˆfd„}|S )Nc                  ó  •—  ‰| i |¤Ž}t        |«      }	 ‰|   \  }}|t        j                  «       kD  r|S 	 t        |«      }t        t        ‰	«      }|�t        j                  «       |z   |f‰|<   |S # t        $ r Y ŒFw xY w©N)Únextr   ÚKeyErrorÚgetattrr   )
ÚargsÚkwargsÚ	generatorr   Úexpiryr   Útime_addÚdctÚkey_funcÚtime_add_settings
          €€€r   Úwrapperz4signature_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   – A3 Á3	A?Á>A?)r
   )r(   r*   r'   r)   s   ` @€r   Ú_tempz#signature_time_cache.<locals>._temp8   s   ú€ ØˆØ),ŒÐ%Ñ&ö	ð ˆr   © )r)   r+   s   ` r   Úsignature_time_cacher-   /   s   ø€ ôð( €Lr   c                 ó   ‡ — ˆ fd„}|S )Nc                 óN   •‡ ‡— i Št        ‰ «      ˆˆ ˆfd„«       }ˆfd„|_        |S )Nc                  óê   •— | t        |j                  «       «      f}	 ‰|   \  }}t        j                  «       |‰z   k  r|S 	  ‰| i |¤Ž}t        j                  «       |f‰|<   |S # t        $ r Y Œ.w xY wr   )Ú	frozensetr   r   r    )r"   r#   r   ÚcreatedÚresultr   ÚfuncÚsecondss        €€€r   r*   z.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& Á&	A2Á1A2c                  ó$   •— ‰ j                  «       S r   )r   )r   s   €r   Ú<lambda>z/time_cache.<locals>.decorator.<locals>.<lambda>`   s   ø€  e§k¡k¤mr   )r   Úclear_cache)r4   r*   r   r5   s   ` @€r   Ú	decoratorztime_cache.<locals>.decoratorP   s-   ú€ Øˆä	ˆt‹õ
	ó 
ð
	ó 4ˆÔØˆr   r,   )r5   r9   s   ` r   Ú
time_cacher:   O   s   ø€ ôð& Ðr   c                 ó.   ‡ — t        ‰ «      ˆ fd„«       }|S )zA normal memoize function.c                 óæ   •— | j                   j                  di «      }|j                  ‰i «      }|t        |j                  «       «      f}	 ||   S # t        $ r  ‰| g|¢­i |¤Ž}|||<   |cY S w xY w)NÚ_memoize_method_dct)Ú__dict__Ú
setdefaultr1   r   r    )Úselfr"   r#   Ú
cache_dictr'   r   r3   Úmethods          €r   r*   zmemoize_method.<locals>.wrapperh   s€   ø€ à—]‘]×-Ñ-Ð.CÀRÓHˆ
Ø×#Ñ# F¨BÓ/ˆØ”Y˜vŸ|™|›~Ó.Ð/ˆð	Ø�s‘8ˆOøÜò 	Ù˜DÐ2 4Ò2¨6Ñ2ˆFØˆC�‰HØŠMð	ús   ÁA ÁA0Á/A0r   )rB   r*   s   ` r   Úmemoize_methodrC   f   s    ø€ ä
ˆ6ƒ]ó	ó ð	ð €Nr   )F)Ú__doc__r   Ú	functoolsr   Útypingr   r   r   Újedir   Úparso.cacher	   r
   ÚstrÚfloatÚ__annotations__Úboolr   r-   r:   rC   r,   r   r   Ú<module>rM      sh   ðòó Ý ß #Ñ #å Ý $à8:€ˆd�3˜˜S %¨¨s¨
Ñ"3Ð3Ñ4Ð4Ñ5Ó :ñ  $ð  °4ó  ò.ò@ó.r   