+
    i                        R t ^ RIHt ^ RIHt  ! R R]4      t]! 4       t]P                  t]P                  t	^ RI
HtHt R tR tR tRR
 lt]! RR4      P#                  4       t]! RR4      t]P#                  4       R8X  d   R	tM	 ]! ]4      t]R8X  d   ]tM/]R8X  d
   ]! ]4      tM]R8X  d
   ]! ]4      tM]! R],          4      hR tR R ltR	#   ] d    ]! RR],          ,           4      hi ; i)zCaching facility for SymPy )import_module)Callablec                   0   a  ] tR t^t o RtR tR tRtV tR# )_cachezList of cached functions c                    V  Fa  pVP                   pTp\        VR4      '       d2   \        VR4      '       d   VP                  4       pMVP                  pKC  Rp\	        W$4       Kc  	  R# )zprint cache info__wrapped__
cache_infoN)__name__hasattrr   r   print)selfitemnamemyfuncinfos   &    N/var/www/html/photoedit/myenv/lib/python3.14/site-packages/sympy/core/cache.pyprint_cache_cache.print_cache   s_     D==DF&-006<00!,,.D#//F$     c                    V  FI  pTp\        VR4      '       g   K  \        VR4      '       d   VP                  4        K=  VP                  pKF  	  R# )zclear cache contentr   cache_clearN)r
   r   r   )r   r   r   s   &  r   clear_cache_cache.clear_cache   sE    DF&-006=11&&(#//F r    N)	r	   
__module____qualname____firstlineno____doc__r   r   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s     $"	0 	0r   r   )	lru_cachewrapsc                   a  V 3R lpV# )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                    <a a \        SR R7      ! S 4      o\        S 4      VV 3R l4       pSP                  Vn        SP                  Vn        \        P                  V4       V# )T)typedc                     <  S! V / VB pV#   \          dO   pTP                  '       d)   TP                  ^ ,          P                  R4      '       g   h S! T / TB p Rp?T# Rp?ii ; i)    zunhashable type:N)	TypeErrorargs
startswith)r)   kwargsretvalecfuncfuncs   *,  r   wrapper0__cacheit.<locals>.func_wrapper.<locals>.wrapperE   si    ///
 M	  /vvvQVVAY%9%9:L%M%Mt.v.M	/s    A&9A!	A!!A&)r!   r"   r   r   CACHEappendr/   r0   r.   maxsizes   f @r   func_wrapper__cacheit.<locals>.func_wrapperB   sY    '.t4	t	 
	 #--#//Wr   r   r5   r6   s   f r   	__cacheitr9   -   s    *& r   c                     V # Nr   )r/   s   &r   __cacheit_nocacher<   Y   s    Kr   c                   a  V 3R lpV# )z)cacheit + code to check cache consistencyc                 X   <a a \        S4      ! S 4      o\        S 4      VV 3R  l4       pV# )c                  v   < S! V / VB pS! V / VB p\        V4      \        V4      3 W#8w  d   \        R 4      hV# )z Returned values are not the same)hashRuntimeError)r)   kw_argsr1r2r.   r/   s   *,  r   r0   6__cacheit_debug.<locals>.func_wrapper.<locals>.wrapperb   sM     t'w'B((B Hd2h x"#EFFIr   )r9   r"   r4   s   f @r   r6   %__cacheit_debug.<locals>.func_wrapper_   s/    '"4(	t	 
	( r   r   r8   s   f r   __cacheit_debugrG   ]   s    2 r   Nc                     ^ RI Hp V! W4      # )r'   )getenv)osrI   )keydefaultrI   s   && r   _getenvrM   {   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                h   a aa RS P                   ,           o\        4       oVVV 3R lp\        V4      # )z"Decorator to cache property method__c                 X   < \        V SS4      pVSJ d   S! V 4      p\        V SV4       V# r;   )getattrsetattr)r   val_cached_property_sentinelattrnamer/   s   & r   propfunc!cached_property.<locals>.propfunc   s5    dH&?@++t*CD(C(
r   )r	   objectproperty)r/   r]   r[   r\   s   f @@r   cached_propertyra      s+    dmm#H & Hr   c                <    V ^8  d   QhR\         R\         R\        /# )   moduler   return)strr   )formats   "r   __annotate__rh      s!     * *3 *s *x *r   c                x   a aaa RoVV V3R lo ! VV V3R lR\         4      p ! VVV V3R lRVR7      pV! 4       # )zCreate a lazy proxy for a function in a module.

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

Nc                  :   < S f   \        \        S4      S4      o S # r;   rX   r   )r/   rd   r   s   r   _get_function$lazy_function.<locals>._get_function   s    <=0$7Dr   c                   <   <a  ] tR t^t o ]VVV3R l4       tRtV tR# )'lazy_function.<locals>.LazyFunctionMetac                x   < S! 4       P                   pVR V P                  P                   RS RS R2,          pV# z

Note: this is a z wrapper of '.'r   	__class__r	   r   	docstringrl   rd   r   s   & r   r   /lazy_function.<locals>.LazyFunctionMeta.__doc__   G    %//I/0G0G/HV\U]]^_c^ddeffIr   r   N)r	   r   r   r   r`   r   r   r   )r    rl   rd   r   s   @r   LazyFunctionMetaro      s     		 
	r   rz   c                   n   <a a ] tR t^t oVVV3R lt]VVV3R l4       tV3R ltV VV3R ltRt	Vt
V ;t# )#lazy_function.<locals>.LazyFunctionc                F   < Sf   \        \        S4      S4      oS! V/ VB # r;   rk   )r   r)   r+   r/   rd   r   s   &*,r   __call__,lazy_function.<locals>.LazyFunction.__call__   s+     |}V4d;(((r   c                x   < S! 4       P                   pVR V P                  P                   RS RS R2,          pV# rq   rt   rv   s   & r   r   +lazy_function.<locals>.LazyFunction.__doc__   ry   r   c                .   < S! 4       P                  4       # r;   )__str__)r   rl   s   &r   r   +lazy_function.<locals>.LazyFunction.__str__   s     ?**,,r   c           	     J   < R SP                    R\        V 4      R RS RS R2	# )<z object at 0xxz>: wrapping 'rr   rs   )r	   id)r   ru   rd   r   s   &r   __repr__,lazy_function.<locals>.LazyFunction.__repr__   s7    y))*-4|=QWPXXYZ^Y__`aar   r   )r	   r   r   r   r~   r`   r   r   r   r   r   __classcell__)ru   r    rl   r/   rd   r   s   @@r   LazyFunctionr|      s/     	) 
	 
	
	-	b 	br   r   )	metaclass)type)rd   r   rz   r   rl   r/   s   ff  @@r   lazy_functionr      s?     D 4 b b!1 b( >r   r;   )r   	importlibr   typingr   listr   r2   r   r   	functoolsr!   r"   r9   r<   rG   rM   lower	USE_CACHEscsrP   int
ValueErrorrA   cacheitra   r   r   r   r   <module>r      s!   " # 0T 0B 	 &(X< 
 %u-335	
  &)99;&*s8 G%()G'./G
4y@B B
*;  *@(()* 	**s   C C2