§
    ŒŸ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dS )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_cachesFÚ
delete_allÚreturnc                 óT  — | rEt                                ¦   «         D ]}|                     ¦   «          Œt          j        ¦   «          dS t                                ¦   «         D ]F}t	          |                     ¦   «         ¦  «        D ]"\  }\  }}|t          j        ¦   «         k     r||= Œ#ŒGdS )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         úW/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/jedi/cache.pyÚclear_time_cachesr      sµ   € ð ð  Ý!×(Ò(Ñ*Ô*ð 	ð 	ˆEØ�KŠK‰MŒMˆMˆMÝÔÑÔÐÐÐõ ×%Ò%Ñ'Ô'ð 	 ð 	 ˆBå#'¨¯ª©
¬
Ñ#3Ô#3ð  ð  ‘�‘Z�a˜Ø•t”y‘{”{’?�?à˜3˜øð ð	 ð 	 ó    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                 ó2   •‡ ‡— i Š‰t           ‰<   ˆˆ ˆfd„}|S )Nc                  ó$  •—  ‰| i |¤Ž}t          |¦  «        }	 ‰|         \  }}|t          j        ¦   «         k    r|S n# t          $ r Y nw xY wt          |¦  «        }t          t          ‰	¦  «        }|�t          j        ¦   «         |z   |f‰|<   |S ©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Ð1ˆIÝ�y‘/”/ˆCðØ # C¤‘�˜Ø�DœI™KœKÒ'Ð'Ø �Lð (øåð ð ð Ø�ðøøøõ ˜‘O”OˆEÝ�xÐ)9Ñ:Ô:ˆHØˆÝœ9™;œ;¨Ñ1°5Ð8��C‘ØˆLs   š#? ¿
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                 ó\   •‡ ‡— i Št          ‰ ¦  «        ˆˆ ˆfd„¦   «         }ˆfd„|_        |S )Nc                  ó   •— | t          |                     ¦   «         ¦  «        f}	 ‰|         \  }}t          j        ¦   «         |‰z   k     r|S n# t          $ r Y nw xY w ‰| i |¤Ž}t          j        ¦   «         |f‰|<   |S r   )Ú	frozensetr   r   r    )r"   r#   r   ÚcreatedÚresultr   ÚfuncÚsecondss        €€€r   r*   z.time_cache.<locals>.decorator.<locals>.wrapperS   sœ   ø€ à� 6§<¢<¡>¤>Ñ2Ô2Ð3ˆCðØ"'¨¤*‘�˜Ý”9‘;”; ¨7Ñ!2Ò2Ð2Ø!�Mð 3øåð ð ð Ø�ðøøøà�T˜4Ð* 6Ð*Ð*ˆFÝœ™œ fÐ,ˆE�#‰JØˆMs   ¦&A Á
AÁAc                  ó,   •— ‰                       ¦   «         S r   )r   )r   s   €r   ú<lambda>z/time_cache.<locals>.decorator.<locals>.<lambda>`   s   ø€  e§k¢k¡m¤m€ r   )r   Úclear_cache)r4   r*   r   r5   s   ` @€r   Ú	decoratorztime_cache.<locals>.decoratorP   sU   øøø€ Øˆå	ˆt‰Œð
	ð 
	ð 
	ð 
	ð 
	ð 
	ñ 
Œð
	ð 4Ð3Ð3Ð3ˆÔØˆr   r,   )r5   r9   s   ` r   Ú
time_cacher:   O   s$   ø€ ðð ð ð ð ð& Ðr   c                 ó<   ‡ — t          ‰ ¦  «        ˆ fd„¦   «         }|S )zA normal memoize function.c                 ó  •— | j                              di ¦  «        }|                     ‰i ¦  «        }|t          |                     ¦   «         ¦  «        f}	 ||         S # t          $ r  ‰| g|¢R 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ÔHˆ
Ø×#Ò# F¨BÑ/Ô/ˆØ•Y˜vŸ|š|™~œ~Ñ.Ô.Ð/ˆð	Ø�s”8ˆOøÝð 	ð 	ð 	Ø�V˜DÐ2 4Ð2Ð2Ð2¨6Ð2Ð2ˆFØˆC�‰HØˆMˆMˆMð	øøøs   ÁA ÁA?Á>A?r   )rB   r*   s   ` r   Úmemoize_methodrC   f   s3   ø€ å
ˆ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      sÿ   ððð ð ð €€€Ø Ð Ð Ð Ð Ð Ø #Ð #Ð #Ð #Ð #Ð #Ð #Ð #Ð #Ð #à Ð Ð Ð Ð Ð Ø $Ð $Ð $Ð $Ð $Ð $à8:€ˆd�3˜˜S %¨¨s¨
Ô"3Ð3Ô4Ð4Ô5Ð :Ð :Ñ :ð ð   $ð  °4ð  ð  ð  ð  ð.ð ð ð@ð ð ð.ð ð ð ð r   