ó
    ‰*£h  ã                   óÐ  • S r SSKJr  SSKJr   " S S\5      r\" 5       r\R                  r\R                  r	SSK
JrJr  S rS rS	 rSS jr\" SS5      R#                  5       r\" SS5      r\R#                  5       S:X  a  S
rO	 \" \5      r\S:X  a  \rO)\S:X  a	  \" \5      rO\S:X  a	  \" \5      rO\" S\-  5      eS rS\S\S\4S jrg
! \ a    \" SS\-  -   5      ef = f)zCaching facility for SymPy é    )Úimport_module)ÚCallablec                   ó$   • \ rS rSrSrS rS rSrg)Ú_cacheé   zList of cached functions c                 óð   • U  Hp  nUR                   nUn[        US5      (       aA  [        US5      (       a  UR                  5       nO!UR                  n[        US5      (       a  MA  Sn[	        X$5        Mr     g)zprint cache infoÚ__wrapped__Ú
cache_infoN)Ú__name__Úhasattrr
   r	   Úprint)ÚselfÚitemÚnameÚmyfuncÚinfos        ÚM/home/mande/repo/quber/.venv/lib/python3.13/site-packages/sympy/core/cache.pyÚprint_cacheÚ_cache.print_cache   sp   € ó ˆDØ—=‘=ˆDØˆFÜ˜& -×0Ñ0Ü˜6 <×0Ñ0Ø!×,Ñ,Ó.�DØà#×/Ñ/�Fô ˜& -×0Ó0ð �ä�$Öò ó    c                 óÄ   • U  HZ  nUn[        US5      (       d  M  [        US5      (       a  UR                  5         M;  UR                  n[        US5      (       a  MB  M\     g)zclear cache contentr	   Úcache_clearN)r   r   r	   )r   r   r   s      r   Úclear_cacheÚ_cache.clear_cache   sT   € ãˆDØˆFÜ˜& -×0Ó0Ü˜6 =×1Ñ1Ø×&Ñ&Ô(Ùà#×/Ñ/�Fô ˜& -×0Õ0ò r   © N)r   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   Ú__static_attributes__r   r   r   r   r      s   † Ù$òõ"	0r   r   )Ú	lru_cacheÚwrapsc                 ó   ^ • U 4S jnU$ )a•  caching decorator.

important: the result of cached function must be *immutable*


Examples
========

>>> from sympy import cacheit
>>> @cacheit
... def f(a, b):
...    return a+b

>>> @cacheit
... def f(a, b): # noqa: F811
...    return [a, b] # <-- WRONG, returns mutable object

to force cacheit to check returned results mutability and consistency,
set environment variable SYMPY_USE_CACHE to 'debug'
c                 óÄ   >^ ^• [        TSS9" T 5      m[        T 5      UU 4S j5       nTR                  Ul        TR                  Ul        [        R                  U5        U$ )NT)Útypedc                  óÄ   >•  T" U 0 UD6nU$ ! [          aH  nUR                  (       a#  UR                  S   R                  S5      (       d  e T" U 0 UD6n S nAU$ S nAff = f)Nr   zunhashable type:)Ú	TypeErrorÚargsÚ
startswith)r(   ÚkwargsÚretvalÚeÚcfuncÚfuncs       €€r   ÚwrapperÚ0__cacheit.<locals>.func_wrapper.<locals>.wrapperE   sg   ø€ ð/Ù Ð/¨Ñ/�ð
 ˆMøô	 ó /Ø—v—v Q§V¡V¨A¡Y×%9Ñ%9Ð:L×%MÑ%MØÙ˜tÐ. vÑ.”ØˆMûð	/ús   ƒ �
A—=AÁA)r!   r"   r
   r   ÚCACHEÚappend©r.   r/   r-   Úmaxsizes   ` @€r   Úfunc_wrapperÚ__cacheit.<locals>.func_wrapperB   sY   ú€ Ü˜'¨Ò.¨tÓ4ˆä	ˆt‹õ	ó 
ð	ð #×-Ñ-ˆÔØ#×/Ñ/ˆÔä�‰�WÔØˆr   r   ©r4   r5   s   ` r   Ú	__cacheitr8   -   s   ø€ õ*ð& Ðr   c                 ó   • U $ ©Nr   )r.   s    r   Ú__cacheit_nocacher;   Y   s   € Ø€Kr   c                 ó   ^ • U 4S jnU$ )z)cacheit + code to check cache consistencyc                 óX   >^ ^• [        T5      " T 5      m[        T 5      UU 4S j5       nU$ )Nc                  ót   >• T" U 0 UD6nT" U 0 UD6n[        U5      [        U5      4  X#:w  a  [        S5      eU$ )Nz Returned values are not the same)ÚhashÚRuntimeError)r(   Úkw_argsÚr1Úr2r-   r.   s       €€r   r/   Ú6__cacheit_debug.<locals>.func_wrapper.<locals>.wrapperb   sM   ø€ ñ �tÐ'˜wÑ'ˆBÙ˜Ð( Ñ(ˆBô �‹H”d˜2“hÑð ‹xÜ"Ð#EÓFÐFØˆIr   )r8   r"   r3   s   ` @€r   r5   Ú%__cacheit_debug.<locals>.func_wrapper_   s/   ú€ Ü˜'Ô" 4Ó(ˆä	ˆt‹õ	ó 
ð	ð( ˆr   r   r7   s   ` r   Ú__cacheit_debugrF   ]   s   ø€ õð2 Ðr   Nc                 ó   • SSK Jn  U" X5      $ )Nr   )Úgetenv)ÚosrH   )ÚkeyÚdefaultrH   s      r   Ú_getenvrL   {   s   € ÝÙ�#ÓÐr   ÚSYMPY_USE_CACHEÚyesÚSYMPY_CACHE_SIZEÚ1000Únonez2SYMPY_CACHE_SIZE must be a valid integer or None. zGot: %sÚnoÚdebugz*unrecognized value for SYMPY_USE_CACHE: %sc                 ó`   ^ ^^• ST R                   -   m[        5       mUUU 4S jn[        U5      $ )z"Decorator to cache property methodÚ__c                 óV   >• [        U TT5      nUTL a  T" U 5      n[        U TU5        U$ r:   )ÚgetattrÚsetattr)r   ÚvalÚ_cached_property_sentinelÚattrnamer.   s     €€€r   ÚpropfuncÚ!cached_property.<locals>.propfuncŸ   s5   ø€ Ü�d˜HÐ&?Ó@ˆØÐ+Ò+Ù�t“*ˆCÜ�D˜( CÔ(Øˆ
r   )r   ÚobjectÚproperty)r.   r\   rZ   r[   s   ` @@r   Úcached_propertyr`   ›   s+   ú€ à�d—m‘mÑ#€HÜ &£Ð÷ô �HÓÐr   Úmoduler   Úreturnc                 ór   ^ ^^^• SmUU U4S jm " UU U4S jS[         5      n " UUU U4S jSUS9nU" 5       $ )z�Create a lazy proxy for a function in a module.

The module containing the function is not imported until the function is used.

Nc                  ó8   >• T c  [        [        T5      T5      m T $ r:   ©rW   r   )r.   ra   r   s   €€€r   Ú_get_functionÚ$lazy_function.<locals>._get_function°   s   ø€ à‰<Üœ=¨Ó0°$Ó7ˆDØˆr   c                   ó0   >• \ rS rSr\U UU4S j5       rSrg)Ú'lazy_function.<locals>.LazyFunctionMetaé·   c                 óp   >• T" 5       R                   nUSU R                  R                   ST ST S3-  nU$ ©Nz

Note: this is a z wrapper of 'Ú.Ú'©r   Ú	__class__r   ©r   Ú	docstringrf   ra   r   s     €€€r   r   Ú/lazy_function.<locals>.LazyFunctionMeta.__doc__¸   óG   ø€ á%›×/Ñ/ˆIØÐ/°·±×0GÑ0GÐ/HÈÐV\ÐU]Ð]^Ð_cÐ^dÐdeÐfÑfˆIØÐr   r   N)r   r   r   r   r_   r   r    )rf   ra   r   s   €€€r   ÚLazyFunctionMetari   ·   s   ø† Ø	ö	ó 
ó	r   ru   c                   ód   >^ • \ rS rSrUUU4S jr\UUU4S j5       rU4S jrU UU4S jrSr	U =r
$ )Ú#lazy_function.<locals>.LazyFunctioné¾   c                 óD   >• Tc  [        [        T5      T5      mT" U0 UD6$ r:   re   )r   r(   r*   r.   ra   r   s      €€€r   Ú__call__Ú,lazy_function.<locals>.LazyFunction.__call__¿   s+   ø€ ð ‰|Üœ}¨VÓ4°dÓ;�Ù˜Ð( Ñ(Ð(r   c                 óp   >• T" 5       R                   nUSU R                  R                   ST ST S3-  nU$ rl   ro   rq   s     €€€r   r   Ú+lazy_function.<locals>.LazyFunction.__doc__Æ   rt   r   c                 ó.   >• T" 5       R                  5       $ r:   )Ú__str__)r   rf   s    €r   r   Ú+lazy_function.<locals>.LazyFunction.__str__Ì   s   ø€ Ù “?×*Ñ*Ó,Ð,r   c           	      óJ   >• STR                    S[        U 5      S ST ST S3	$ )NÚ<z object at 0xÚxz>: wrapping 'rm   rn   )r   Úid)r   rp   ra   r   s    €€€r   Ú__repr__Ú,lazy_function.<locals>.LazyFunction.__repr__Ï   s7   ø€ Ø�y×)Ñ)Ð*¨-¼¸4»À°|À=ÐQWÐPXÐXYÐZ^ÐY_Ð_`ÐaÐar   r   )r   r   r   r   rz   r_   r   r   r…   r    Ú__classcell__)rp   rf   r.   ra   r   s   @€€€€r   ÚLazyFunctionrw   ¾   s-   ù† ÷	)ð 
ö	ó 
ð	õ
	-÷	bõ 	br   rˆ   )Ú	metaclass)Útype)ra   r   ru   rˆ   rf   r.   s   ``  @@r   Úlazy_functionr‹   ¨   s?   û€ ð €D÷÷ñ œ4ô ÷bò bÐ!1ò bñ( ‹>Ðr   r:   )r   Ú	importlibr   Útypingr   Úlistr   r1   r   r   Ú	functoolsr!   r"   r8   r;   rF   rL   ÚlowerÚ	USE_CACHEÚscsrO   ÚintÚ
ValueErrorr@   Úcacheitr`   Ústrr‹   r   r   r   Ú<module>r—      s6  ðÙ "Ý #Ý ô0ˆTô 0ñB 	‹€à×Ñ€Ø×Ñ€ç &ò(òXòô< ñ
 Ð% uÓ-×3Ñ3Ó5€	ñ
 Ð  &Ó)€Ø‡9�9ƒ;�&ÓØÑð*Ù˜s›8Ðð �ÓØ�GØ�%ÓÙÐ(Ó)�GØ�'ÓÙÐ.Ó/�Gá
Ø4°yÑ@óBð Bò
ð*˜3ð * sð *¨xõ *øð; ó *ÙØ@ØÐ(Ñ(ñ)ó*ð 	*ð*ús   ÂC ÃC%