+
    ‹°³j°+  ã                   ó²   € R t ^ RIHt ^ RIt^ RIt^ RIt^ RIHtHt ^ RI	H
t
 ]! R4      t R tR tR tR	 t ! R
 R4      tRR ltR R ltR tR^/R ltR# )zUseful utility decorators. )ÚTypeVarN)ÚwrapsÚupdate_wrapper©Úsympy_deprecation_warningÚTc                ód   a aaaa€ ^ RI Ho ^ RIHo ^ RIHo \        S 4      VV VVV3R l4       pV# )z'A factory for ``threaded`` decorators. )Úsympify)Ú
MatrixBase)Úiterablec           
      ód  <aa€ \        V S4      '       d   V P                  VVV3R  l4      # S! V 4      '       d-    T P                  V  Uu. uF  pS! V.SO5/ SB NK  	  up4      # S! V 4      p S'       dG   V P                  '       d5   V P                  ! V P
                   Uu. uF  pS! V.SO5/ SB NK  	  up!  # V P                  '       d;   V P                  S! V P                  .SO5/ SB S! V P                  .SO5/ SB 4      # S! V .SO5/ SB # u upi   \         d    T u # i ; iu upi )c                 ó   <€ S! V .SO5/ SB # ©N© )ÚfÚargsÚfuncÚkwargss   &€€€ÚZ/home/luca/screen-checking/.venv/lib/python3.14/site-packages/sympy/utilities/decorator.pyÚ<lambda>Ú9threaded_factory.<locals>.threaded_func.<locals>.<lambda>   s   ø€ ©D°Ð,D°TÒ,D¸VÒ,Dó    )	Ú
isinstanceÚ	applyfuncÚ	__class__Ú	TypeErrorÚis_Addr   Úis_RelationalÚlhsÚrhs)	Úexprr   r   r   r
   r   r   r	   Úuse_adds	   &jl €€€€€r   Úthreaded_funcÚ'threaded_factory.<locals>.threaded_func   s"  ú€ ä�d˜J×'Ò'Ø—>‘>Ö"DÓEÐEÙ�d�^Š^ðØ—~‘~ÉÓ&NÉÀA¡t¨AÐ'?°Ò'?¸Ô'?ÉÑ&NÓOÐOñ ˜4“=ˆDç˜4Ÿ;Ÿ;˜;Ø—~’~È4Ï9Ê9Ó'VÉ9Àa©¨aÐ)A°$Ò)A¸&Ô)AÉ9Ñ'VÑWÐWØ×#×#Ð#Ø—~‘~¡d¨4¯8©8Ð&E°dÒ&E¸fÑ&EÙ&*¨4¯8©8Ð&E°dÒ&E¸fÑ&EóGð Gñ ˜DÐ2 4Ò2¨6Ñ2Ð2ùò 'OøÜô Ø’ðüò (Ws)   ¼D ÁDÁ D Â#D-ÄD ÄD*Ä)D*)Ú
sympy.corer	   Úsympy.matricesr
   Úsympy.utilities.iterablesr   r   )r   r!   r"   r
   r   r	   s   ff @@@r   Úthreaded_factoryr'      s/   ü€ å"Ý)Ý2ä
ˆ4ƒ[÷3ð 3ó ð3ð& Ðr   c                ó   € \        V R4      # )a-  Apply ``func`` to sub--elements of an object, including :class:`~.Add`.

This decorator is intended to make it uniformly possible to apply a
function to all elements of composite objects, e.g. matrices, lists, tuples
and other iterable containers, or just expressions.

This version of :func:`threaded` decorator allows threading over
elements of :class:`~.Add` class. If this behavior is not desirable
use :func:`xthreaded` decorator.

Functions using this decorator must have the following signature::

  @threaded
  def function(expr, *args, **kwargs):

T©r'   ©r   s   &r   Úthreadedr+   -   s   € ô" ˜D $Ó'Ð'r   c                ó   € \        V R4      # )a0  Apply ``func`` to sub--elements of an object, excluding :class:`~.Add`.

This decorator is intended to make it uniformly possible to apply a
function to all elements of composite objects, e.g. matrices, lists, tuples
and other iterable containers, or just expressions.

This version of :func:`threaded` decorator disallows threading over
elements of :class:`~.Add` class. If this behavior is not desirable
use :func:`threaded` decorator.

Functions using this decorator must have the following signature::

  @xthreaded
  def function(expr, *args, **kwargs):

Fr)   r*   s   &r   Ú	xthreadedr-   A   s   € ô" ˜D %Ó(Ð(r   c                ó8   a a€ ^ RI oV V3R lp\        VS 4      pV# )zsAfter the function finishes, resets the value of ``mpmath.mp.dps`` to
the value it had before the function was run.Nc                  ó�   <€ SP                   P                  p S! V / VB VSP                   n        #   TSP                   n        i ; ir   )ÚmpÚdps)r   r   r1   r   Úmpmaths   *, €€r   Úfunc_wrapperÚ)conserve_mpmath_dps.<locals>.func_wrapperZ   s9   ø€ Ø�i‰i�m‰mˆð	 Ù˜Ð( Ñ(àˆF�I‰I�Mø˜CˆF�I‰I�Mús	   ™2 ²A)r2   r   )r   r3   r2   s   f @r   Úconserve_mpmath_dpsr5   U   s!   ù€ ó ö ô " ,°Ó5€LØÐr   c                   ó4   a € ] tR t^et o RtR tRR ltRtV tR# )Úno_attrs_in_subclassa  Don't 'inherit' certain attributes from a base class

>>> from sympy.utilities.decorator import no_attrs_in_subclass

>>> class A(object):
...     x = 'test'

>>> A.x = no_attrs_in_subclass(A, A.x)

>>> class B(A):
...     pass

>>> hasattr(A, 'x')
True
>>> hasattr(B, 'x')
False

c                ó   € Wn         W n        R # r   ©Úclsr   )Úselfr:   r   s   &&&r   Ú__init__Úno_attrs_in_subclass.__init__x   s   € ØŒØŽr   Nc                ó´   € W P                   8X  dD   \        V P                  R 4      '       d   V P                  P                  W4      # V P                  # \        h)Ú__get__)r:   Úhasattrr   r?   ÚAttributeError)r;   ÚinstanceÚowners   &&&r   r?   Úno_attrs_in_subclass.__get__|   s?   € Ø—H‘HÔÜ�t—v‘v˜y×)Ò)Ø—v‘v—~‘~ hÓ6Ð6Ø—6‘6ˆMÜÐr   r9   r   )	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r<   r?   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r7   r7   e   s   ø‡ € ñò$÷ò r   r7   c                ó‚   aa€ / oV e   V SR&   Ve   VSR&   Ve   VSR&   Ve   VSR&   Ve   VSR&   V3R loVV3R lpV# )a�  
Adds metadata about the dependencies which need to be met for doctesting
the docstrings of the decorated objects.

``exe`` should be a list of executables

``modules`` should be a list of modules

``disable_viewers`` should be a list of viewers for :func:`~sympy.printing.preview.preview` to disable

``python_version`` should be the minimum Python version required, as a tuple
(like ``(3, 0)``)
ÚexecutablesÚmodulesÚdisable_viewersÚpython_versionÚground_typesc                  ó~   <€ ^ RI Hp HpHp V! 4       pV! VR4      p VP                  ! R/ SB  R#   T  d     R# i ; i)é    )ÚDependencyErrorÚSymPyDocTestsÚPyTestReporterNFTr   )Úsympy.testing.runtestsrU   rV   rW   Ú_check_dependencies)rU   rV   rW   ÚrÚtÚdependenciess        €r   Ú	skiptestsÚ%doctest_depends_on.<locals>.skiptestsŸ   sL   ø€ ßYÑYÙÓˆÙ˜!˜TÓ"ˆð	Ø×!Ò!Ñ1 LÒ1ñ øð ô 	Úð	ús   �1 ±<»<c                 óÄ   <€ SV n         SV n        \        P                  ! V 4      '       d5   \	        W P                   4      V n        \	        W P                  4      V n        V # r   )Ú_doctest_depends_onÚ__doctest_skip__ÚinspectÚisclassr7   Ú_doctest_depdends_on)Úfnr\   r]   s   &€€r   Údepends_on_decoÚ+doctest_depends_on.<locals>.depends_on_decoª   sS   ø€ Ø!-ˆÔØ'ˆÔä�?Š?˜2×ÒÜ&:Ø×*Ñ*ó',ˆBÔ#ä"6Ø×'Ñ'ó#)ˆBÔàˆ	r   r   )ÚexerO   rP   rQ   rR   rf   r\   r]   s   &&&&& @@r   Údoctest_depends_onri   „   sm   ù€ ð €LØ
‚Ø&)ˆ�]Ñ#ØÒØ")ˆ�YÑØÒ"Ø*9ˆÐ&Ñ'ØÒ!Ø)7ˆÐ%Ñ&ØÒØ'3ˆ�^Ñ$õ	ö	ð Ðr   c                ó0   € V ^8„  d   QhR\         R\         /# )é   ÚobjÚreturn)r   )Úformats   "r   Ú__annotate__ro   ¸   s   € ÷ .ñ .”ð .”añ .r   c                ó¤  € \        V \        P                  4      '       d   V P                  pV P                  pMo\        V \        \
        4      \
        34      '       d9   \        P                  V P                  ,          P                  pV P                  pM\        RV ,          4      hRV9  d	   V.VR&   V # VR,          P                  V4       V # )a�  
Append ``obj``'s name to global ``__all__`` variable (call site).

By using this decorator on functions or classes you achieve the same goal
as by filling ``__all__`` variables manually, you just do not have to repeat
yourself (object's name). You also know if object is public at definition
site, not at some random location (where ``__all__`` was set).

Note that in multiple decorator setup (in almost all cases) ``@public``
decorator must be applied before any other decorators, because it relies
on the pointer to object's global namespace. If you apply other decorators
first, ``@public`` may end up modifying the wrong namespace.

Examples
========

>>> from sympy.utilities.decorator import public

>>> __all__ # noqa: F821
Traceback (most recent call last):
...
NameError: name '__all__' is not defined

>>> @public
... def some_function():
...     pass

>>> __all__ # noqa: F821
['some_function']

z&expected a function or a class, got %sÚ__all__)r   ÚtypesÚFunctionTypeÚ__globals__rE   ÚtypeÚsysrO   rF   Ú__dict__r   Úappend)rl   ÚnsÚnames   &  r   Úpublicr{   ¸   s¥   € ô@ �#”u×)Ñ)×*Ò*Ø�_‰_ˆØ�|‰|‰Ü	�Cœ$œt›*¤dÐ+×	,Ò	,Ü�[‰[˜Ÿ™Õ(×1Ñ1ˆØ�|‰|‰äÐ@À3ÕFÓGÐGà˜ÔØ˜ˆˆ9‰ð €Jð 	ˆ9�×Ñ˜TÔ"à€Jr   c                ó„   a aa€ RS P                   ,           o\        4       o\        S 4      VV V3R l4       p\        V4      # )zÅProperty decorator that caches the value of potentially expensive
``propfunc`` after the first evaluation. The cached value is stored in
the corresponding property name with an attached underscore.Ú_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ÚattrnameÚpropfuncÚsentinels   & €€€r   ÚaccessorÚ"memoize_property.<locals>.accessorð   s2   ø€ ä�d˜H hÓ/ˆØ�(‹?Ù˜4“.ˆCÜ�D˜( CÔ(Øˆ
r   )rE   Úobjectr   Úproperty)rƒ   r…   r‚   r„   s   f @@r   Úmemoize_propertyr‰   é   s?   ú€ ð �X×&Ñ&Õ&€HÜ‹x€Hä
ˆ8ƒ_öó ðô �HÓÐr   Ú
stacklevelc               ó(   a aa€ RVRV/oVV V3R lpV# )aÆ  
Mark a function as deprecated.

This decorator should be used if an entire function or class is
deprecated. If only a certain functionality is deprecated, you should use
:func:`~.warns_deprecated_sympy` directly. This decorator is just a
convenience. There is no functional difference between using this
decorator and calling ``warns_deprecated_sympy()`` at the top of the
function.

The decorator takes the same arguments as
:func:`~.warns_deprecated_sympy`. See its
documentation for details on what the keywords to this decorator do.

See the :ref:`deprecation-policy` document for details on when and how
things should be deprecated in SymPy.

Examples
========

>>> from sympy.utilities.decorator import deprecated
>>> from sympy import simplify
>>> @deprecated("""    ... The simplify_this(expr) function is deprecated. Use simplify(expr)
... instead.""", deprecated_since_version="1.1",
... active_deprecations_target='simplify-this-deprecation')
... def simplify_this(expr):
...     """
...     Simplify ``expr``.
...
...     .. deprecated:: 1.1
...
...        The ``simplify_this`` function is deprecated. Use :func:`simplify`
...        instead. See its documentation for more information. See
...        :ref:`simplify-this-deprecation` for details.
...
...     """
...     return simplify(expr)
>>> from sympy.abc import x
>>> simplify_this(x*(x + 1) - x**2) # doctest: +SKIP
<stdin>:1: SymPyDeprecationWarning:
<BLANKLINE>
The simplify_this(expr) function is deprecated. Use simplify(expr)
instead.
<BLANKLINE>
See https://docs.sympy.org/latest/explanation/active-deprecations.html#simplify-this-deprecation
for details.
<BLANKLINE>
This has been deprecated since SymPy version 1.1. It
will be removed in a future version of SymPy.
<BLANKLINE>
  simplify_this(x)
x

See Also
========
sympy.utilities.exceptions.SymPyDeprecationWarning
sympy.utilities.exceptions.sympy_deprecation_warning
sympy.utilities.exceptions.ignore_warnings
sympy.testing.pytest.warns_deprecated_sympy

Údeprecated_since_versionÚactive_deprecations_targetc                 ó²   <a € \        S R 4      '       d%    ! VVVV 3R lRS 4      pS P                  Vn        V# \        S 4      VVVV 3R l4       pS Vn        V# )Ú__mro__c                   óº   <a a€ ] tR tRt o ZP                  t ZP                  t ZtR ZP                  9   d   V VVV3R ltRt	Vt
V ;t# V VVV3R ltRt	Vt
V ;t# )Ú9deprecated.<locals>.deprecated_decorator.<locals>.wrapperi?  Ú__new__c                óL   <€ \        S3/ SBR S/B  \        SV `  ! V .VO5/ VB # ©rŠ   )r   Úsuperr’   )r:   r   r   r   Údecorator_kwargsÚmessagerŠ   s   &*,€€€€r   r’   ÚAdeprecated.<locals>.deprecated_decorator.<locals>.wrapper.__new__D  s0   ø€ Ü1°'ÑeÐ=MÑeÐZdÓeÜ$™wš¨sÐD°TÒD¸VÑDÐDr   c                óH   <€ \        S3/ SBR S/B  \        SV `  ! V/ VB  R# )rŠ   N)r   r•   r<   )r;   r   r   r   r–   r—   rŠ   s   &*,€€€€r   r<   ÚBdeprecated.<locals>.deprecated_decorator.<locals>.wrapper.__init__H  s)   ø€ Ü1°'ÑeÐ=MÑeÐZdÓeÜ™Ò(¨$Ð9°&Ô9r   r   )rE   rF   rG   rH   rI   Ú_sympy_deprecated_funcrw   r’   r<   rJ   rK   Ú__classcell__)r   rL   r–   r—   rŠ   Úwrappeds   @@€€€€r   Úwrapperr‘   ?  sN   ú‡ € Ù!Ÿ/™/�Ù$×/Ñ/�
Ù)0Ð&Ø¡× 0Ñ 0Ô0÷E÷ Eð E÷:÷ :ð :r   rž   c                  ó4   <€ \        S3/ SBR S/B  S! V / VB # r”   r   )r   r   r–   r—   rŠ   r�   s   *,€€€€r   rž   r‘   M  s'   ø€ ä)¨'Ñ]Ð5EÑ]ÐR\Ó]Ù Ð/¨Ñ/Ð/r   )r@   rE   r   r›   )r�   rž   r–   r—   rŠ   s   f €€€r   Údeprecated_decoratorÚ(deprecated.<locals>.deprecated_decorator=  s_   ù€ Ü�7˜I×&Ò&÷:ò :˜'ô :ð  '×/Ñ/ˆGÔð ˆô �7‹^÷0ó ð0ð .5ˆGÔ*Øˆr   r   )r—   rŒ   r�   rŠ   r    r–   s   f$$d @r   Ú
deprecatedr¢   û   s(   ú€ ð@ 3Ð4LØ+Ð-GðIÐ÷ð,  Ðr   )NNNNN)rI   Útypingr   rv   rr   rb   Ú	functoolsr   r   Úsympy.utilities.exceptionsr   r   r'   r+   r-   r5   r7   ri   r{   r‰   r¢   r   r   r   Ú<module>r¦      sf   ðÙ !å Û 
Û Û ß +å @ñ ˆCƒL€Ø òò:(ò()ò(÷ ñ ô>1õh.òbð$X Ø67öX r   