
    \h-                        S r SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
Jr  SSKJrJr   " S	 S
\5      r\" \5      S 5       rg)z
A Printer for generating executable code.

The most important function here is srepr that returns a string so that the
relation eval(srepr(expr))=expr holds in an appropriate environment.
    )annotations)Any)AppliedUndef)Mul)repr_dpsto_str   )Printerprint_functionc                  t   \ rS rSr% SrSSS.rS\S'   S rS	 rS>S
 jr	S r
S rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS  rS! r S" r!S# r"S$ r#S>S% jr$S& r%S' r&S( r'S) r(S* r)S+ r*S, r+S- r,S. r-S/ r.S0 r/S1 r0S2 r1S3 r2S4 r3S5 r4S6 r5S7 r6S8 r7S9 r8S: r9S; r:S< r;S=r<g)?ReprPrinter   
_sympyreprNT)orderperm_cycliczdict[str, Any]_default_settingsc                l    UR                  U Vs/ s H  o0R                  U5      PM     sn5      $ s  snf )z7
Prints each item in `args` and joins them with `sep`.
)joindoprint)selfargssepitems       K/var/www/auris/envauris/lib/python3.13/site-packages/sympy/printing/repr.pyreprifyReprPrinter.reprify   s,     xx=d+=>>=s   1c                "   [        U[        5      (       a  U$ [        US5      (       a  UR                  5       $ [        US5      (       a{  [        UR                  S5      (       a`  / nUR                   H#  nUR                  U R                  U5      5        M%     UR                  R                  SSR                  U5      -  -   $ [        US5      (       a0  [        US5      (       a  SUR                  < S	UR                  < S
3$ [        U5      $ )z
The fallback printer.
	__srepr__r   __iter__(%s), 
__module____name__z<'.z'>)
isinstancestrhasattrr   r   append_print	__class__r#   r   r"   )r   exprlos       r   emptyPrinterReprPrinter.emptyPrinter    s     dC  KT;''>>##T6""wtyy*'E'EAYYQ( >>**Vdiil-BBBT<((WT:-F-F"&//4==AAt9    c                    U R                  XS9n[        U R                  U5      n[        U5      R                  nUSSR                  U5      -  -   $ )N)r   r    r!   )_as_ordered_termsmapr)   typer#   r   r   r+   r   r   clsnames        r   
_print_AddReprPrinter._print_Add2   sL    %%d%84;;%t*%%$))D/111r0   c                "    UR                  5       $ N)__repr__r   r+   s     r   _print_CycleReprPrinter._print_Cycle8   s    }}r0   c                   SSK JnJn  SSKJn  UR
                  nUb  U" SU S3SSSS	9  OU R                  R                  S
S5      nU(       au  UR                  (       d  gU" U5      " UR                  S-
  5      R                  5       [        S5      S  nUR                  S5      nUS:X  d  SXgS  ;  a
  XgS  US U -   nSU-  $ UR                  5       nU(       d7  UR                  S:  a  S[        UR                  5      -  $ SUR                  -  $ [        UR                  S US   S-    5      SUR                  -  -   n[        UR                  5      =p[        U5      [        U
5      :  a  Un	SU	-  $ )Nr   )PermutationCycle)sympy_deprecation_warningzw
                Setting Permutation.print_cyclic is deprecated. Instead use
                init_printing(perm_cyclic=z).
                z1.6z#deprecated-permutation-print_cyclic   )deprecated_since_versionactive_deprecations_target
stacklevelr   TzPermutation()r	   rA   (,zPermutation%s   zPermutation(%s)zPermutation([], size=%s)z	, size=%s) sympy.combinatorics.permutationsr@   rA   sympy.utilities.exceptionsrB   print_cyclic	_settingsgetsizer;   lenrfindsupportr&   
array_form)r   r+   r@   rA   rB   r   slasttrimusefulls              r   _print_PermutationReprPrinter._print_Permutation;   sg   GH!.."%++6- 8 */+P ..,,]DAK99& dDIIM*335c'lmDA773<D19AeH!4eHq$x'"A%%A99q=,s4??/CCC1DII==tz"	23kDII6MMDT__--C4y3t9$$s**r0   c           
         U R                  UR                  5      nUSSR                  UR                   Vs/ s H  o0R                  U5      PM     sn5      -  -  nU$ s  snf Nr    r!   )r)   funcr   r   r   r+   ras       r   _print_FunctionReprPrinter._print_Functionc   sP    KK		"	Vdii CAQ CDDD !D   Ac           
         U R                  UR                  5      nUSSR                  UR                   Vs/ s H  o0R                  U5      PM     sn5      -  -  nU$ s  snf r]   )r)   r^   r   pargsr_   s       r   _print_HeavisideReprPrinter._print_Heavisideh   sR     KK		"	Vdii DAQ DEEE !Erd   c                b    [        U[        5      (       a  SUR                  -  $ UR                  $ )NzFunction(%r))
issubclassr   r#   r<   s     r   _print_FunctionClass ReprPrinter._print_FunctionClasso   s(    dL))!T]]33== r0   c                    g)NzRational(1, 2) r<   s     r   _print_HalfReprPrinter._print_Halfu   s    r0   c                    [        U5      $ r:   r&   r<   s     r   _print_RationalConstant#ReprPrinter._print_RationalConstantx       4yr0   c                    [        U5      $ r:   rr   r<   s     r   _print_AtomicExprReprPrinter._print_AtomicExpr{   ru   r0   c                    [        U5      $ r:   rr   r<   s     r   _print_NumberSymbolReprPrinter._print_NumberSymbol~   ru   r0   c                     SUR                   -  $ )NzInteger(%i))pr<   s     r   _print_IntegerReprPrinter._print_Integer   s    tvv%%r0   c                    g)N	Complexesrn   r<   s     r   _print_ComplexesReprPrinter._print_Complexes       r0   c                    g)NIntegersrn   r<   s     r   _print_IntegersReprPrinter._print_Integers       r0   c                    g)NNaturalsrn   r<   s     r   _print_NaturalsReprPrinter._print_Naturals   r   r0   c                    g)N	Naturals0rn   r<   s     r   _print_Naturals0ReprPrinter._print_Naturals0   r   r0   c                    g)N	Rationalsrn   r<   s     r   _print_RationalsReprPrinter._print_Rationals   r   r0   c                    g)NRealsrn   r<   s     r   _print_RealsReprPrinter._print_Reals       r0   c                    g)NEmptySetrn   r<   s     r   _print_EmptySetReprPrinter._print_EmptySet   r   r0   c                    g)NUniversalSetrn   r<   s     r   _print_UniversalSetReprPrinter._print_UniversalSet   s    r0   c                    g)NEmptySequencern   r<   s     r   _print_EmptySequence ReprPrinter._print_EmptySequence   s    r0   c                ,    SU R                  US5      -  $ )Nz[%s]r!   r   r<   s     r   _print_listReprPrinter._print_list   s    T4000r0   c           	         SnUR                  5        VVs/ s H,  u  p4U R                  U5      < SU R                  U5      < 3PM.     nnnSUR                  U5      -  $ s  snnf )Nr!   z: {%s})itemsr   r   )r   r+   r   keyvaluedict_kvss         r   _print_dictReprPrinter._print_dict   sY    Z^ZdZdZfgZfJCS 14<<3FGZfg*** hs   3A c                <    U(       d  gSU R                  US5      -  $ )Nzset()r   r!   r   r<   s     r   
_print_setReprPrinter._print_set   s    T4000r0   c           	     8   UR                   S:H  UR                  S:H  -  (       ag  UR                  R                  < SU R	                  UR                   5      < SU R	                  UR                  5      < SU R	                  / 5      < S3$ / n[        UR                   5       HH  nUR                  / 5        [        UR                  5       H  nUS   R                  XU4   5        M     MJ     UR                  R                  < SU R	                  U5      < S3$ )Nr   rG   r!   )rJ   )rowscolsr*   r#   r)   ranger(   )r   r+   r,   ijs        r   _print_MatrixBaseReprPrinter._print_MatrixBase   s    IINtyyA~.'+~~'>'>'+{{499'='+{{499'='+{{28 8 tyy!AHHRL499%"TQ$Z( & "  >>22DKKNCCr0   c                    g)Ntruern   r<   s     r   _print_BooleanTrueReprPrinter._print_BooleanTrue   s    r0   c                    g)Nfalsern   r<   s     r   _print_BooleanFalseReprPrinter._print_BooleanFalse   r   r0   c                    g)Nnanrn   r<   s     r   
_print_NaNReprPrinter._print_NaN   s    r0   c                    U R                   S;  a  UR                  5       nO[        R                  " U5      n[	        U R
                  U5      n[        U5      R                  nUSSR                  U5      -  -   $ )N)oldnoner    r!   )	r   as_ordered_factorsr   	make_argsr3   r)   r4   r#   r   r5   s        r   
_print_MulReprPrinter._print_Mul   sc    ::_,**,D ==&D4;;%t*%%$))D/111r0   c                |    SU R                  UR                  5      < SU R                  UR                  5      < S3$ )Nz	Rational(r!   r   )r)   r}   qr<   s     r   _print_RationalReprPrinter._print_Rational   s'    %)[[%8$++dff:MNNr0   c                b    SUR                   R                  UR                  UR                  4-  $ )Nz
%s(%d, %d))r*   r#   r}   r   r<   s     r   _print_PythonRational!ReprPrinter._print_PythonRational   s&    t~~66GGGr0   c                |    SU R                  UR                  5      < SU R                  UR                  5      < S3$ )Nz	Fraction(r!   r   )r)   	numeratordenominatorr<   s     r   _print_FractionReprPrinter._print_Fraction   s)    %)[[%@$++dN^N^B_``r0   c                    [        UR                  [        UR                  5      5      nSUR                  R
                  X!R                  4-  $ )Nz%s('%s', precision=%i))mlib_to_str_mpf_r   _precr*   r#   )r   r+   r`   s      r   _print_FloatReprPrinter._print_Float   s9    

HTZZ$89'4>>+B+BAzz*RRRr0   c           
         SU R                  UR                  5      < SU R                  UR                  5      < SU R                  UR                  5      < SU R                  UR                  5      < S3	$ )NzSum2(z, (r!   z)))r)   fr   ra   br<   s     r   _print_Sum2ReprPrinter._print_Sum2   sL    +/;;tvv+>DFF@S+/;;tvv+>DFF@SU 	Ur0   c                p    UR                   R                  < SU R                  UR                  5      < S3$ NrG   r   )r*   r#   r)   name)r   rU   s     r   
_print_StrReprPrinter._print_Str   s$    ;;//QVV1DEEr0   c                   UR                   nUR                  (       a  UR                  5       nUR                  US'   U0 :X  a7  UR                  R
                  < SU R                  UR                  5      < S3$ UR                  5        VVs/ s H  u  p4U< SU< 3PM     nnnUR                  R
                  < SU R                  UR                  5      < SSR                  U5      < S3$ s  snnf )Ndummy_indexrG   r   =r!   )
_assumptions_origis_Dummycopyr   r*   r#   r)   r   r   r   r   r+   dkvattrs         r   _print_SymbolReprPrinter._print_Symbol   s    ""==A#//Am7#~~66DII8NOO12;q!$D;#'>>#:#:#';;tyy#9499T?L L <s   C/c           	        UR                   R                  nU0 :X  aT  UR                  R                  < SU R	                  UR
                  5      < SU R	                  UR                  5      < S3$ UR                  5        VVs/ s H  u  p4U< SU< 3PM     nnnUR                  R                  < SU R	                  UR
                  5      < SU R	                  UR                  5      < SSR                  U5      < S3$ s  snnf )NrG   r!   r   r   )	_assumptions	generatorr*   r#   r)   	coord_sysindexr   r   r   s         r   _print_CoordinateSymbol#ReprPrinter._print_CoordinateSymbol   s    ''7''DNN+DJJ'  23;q!$D;''DNN+DJJ'		$	  <s   Dc                     SUR                   -  $ )NzQ.%s)r   r<   s     r   _print_PredicateReprPrinter._print_Predicate  s    		!!r0   c                v    UR                   nUR                  R                  < SU R                  US5      < S3$ NrG   r!   r   )_argsr*   r#   r   )r   r+   r   s      r   _print_AppliedPredicate#ReprPrinter._print_AppliedPredicate  s+    zz>>22DLLt4LMMr0   c                    [        U5      $ r:   )reprr<   s     r   
_print_strReprPrinter._print_str
  s    Dzr0   c                x    [        U5      S:X  a  SU R                  US   5      -  $ SU R                  US5      -  $ )Nr	   z(%s,)r   r    r!   )rQ   r)   r   r<   s     r   _print_tupleReprPrinter._print_tuple  s;    t9>T[[a111DLLt444r0   c                R    UR                   R                  < SUR                  < S3$ )Nz('z'))r*   r#   r   r<   s     r   _print_WildFunctionReprPrinter._print_WildFunction  s    !^^44dii@@r0   c                    UR                   R                  < SU R                  UR                  5      < SU R                  UR	                  5       5      < S3$ r  )r*   r#   r)   rootcoeffsr<   s     r   _print_AlgebraicNumber"ReprPrinter._print_AlgebraicNumber  s<    #~~66KK		"DKK$>@ 	@r0   c           	         UR                   R                  < SU R                  UR                  5      < SU R                  UR                  5      < SU R                  UR
                  5      < S3$ r  r*   r#   r)   symbolsdomainr   )r   rings     r   _print_PolyRingReprPrinter._print_PolyRing  sI    #'>>#:#:KK%t{{4;;'?TZZAXZ 	Zr0   c           	         UR                   R                  < SU R                  UR                  5      < SU R                  UR                  5      < SU R                  UR
                  5      < S3$ r  r  )r   fields     r   _print_FracFieldReprPrinter._print_FracField  sI    #(??#;#;KK&ELL(A4;;u{{C[] 	]r0   c                   [        UR                  5       5      nUR                  UR                  R                  SS9  UR
                  R                  < SU R                  UR                  5      < SU R                  U5      < S3$ NT)r   reverserG   r!   r   )listtermssortr  r   r*   r#   r)   )r   polyr(  s      r   _print_PolyElementReprPrinter._print_PolyElement"  s[    TZZ\"

tyy
5#~~66DII8NPTP[P[\aPbccr0   c                   [        UR                  R                  5       5      nUR                  UR                  R
                  SS9  [        UR                  R                  5       5      nUR                  UR                  R
                  SS9  U R                  U5      nU R                  U5      nUR                  R                  < SU R                  UR                  5      < SU< SU< S3$ r%  )
r'  numerr(  r)  r!  r   denomr)   r*   r#   )r   fracnumer_termsdenom_termsr.  r/  s         r   _print_FracElementReprPrinter._print_FracElement'  s    4::++-.TZZ--t<4::++-.TZZ--t<K(K(#'>>#:#:DKK

<SUZ\abbr0   c                x    UR                   R                  nU R                  UR                  5      nU< SU< S3$ r   )r*   r#   r)   r!  )r   r  clsr!  s       r   _print_FractionField ReprPrinter._print_FractionField0  s0    ''FLL)&&r0   c                <   UR                   R                  nU R                  UR                  5      nSR	                  [        U R                  UR                  5      5      n[        UR                  5      nXQR                  :w  a  SU-   nOSnU< SU< SU< U< S3$ )Nr!   z, order= rG   r   )
r*   r#   r)   r  r   r3   gensr&   r   default_order)r   r  r6  domr;  r   orderstrs          r   _print_PolynomialRingBase%ReprPrinter._print_PolynomialRingBase5  sw    nn%%kk$++&yyT[[$))45DJJ&&&!E)HH!$c4::r0   c                    UR                   R                  nU R                  UR                  5       5      nU R                  UR                  5      nU< SU< SU< S3$ r  )r*   r#   r)   to_listr=  )r   r}   r6  repr=  s        r   
_print_DMPReprPrinter._print_DMP@  sD    kk""kk!))+&kk!%% "C--r0   c                2    S[        UR                  5      -  $ )NzFiniteExtension(%s))r&   modulus)r   exts     r   _print_MonogenicFiniteExtension+ReprPrinter._print_MonogenicFiniteExtensionF  s     %s3;;'777r0   c                    U R                  UR                  5      nU R                  UR                  5      nSU< SU< S3$ )NzExtElem(r!   r   )r)   rC  rH  )r   r   rC  rH  s       r   _print_ExtensionElement#ReprPrinter._print_ExtensionElementK  s1    kk!%% kk!%% $'--r0   rn   r:   )=r#   r"   __qualname____firstlineno__printmethodr   __annotations__r   r.   r7   r=   rZ   rb   rg   rk   ro   rs   rw   rz   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r"  r+  r3  r7  r?  rD  rI  rL  __static_attributes__rn   r0   r   r   r      s7   K )~ 
?$2&+P
! &1+
1
D	2OHaSUFL$"N
5A@Z]d
c'
	;.8
.r0   r   c                6    [        U5      R                  U 5      $ )zreturn expr in repr form)r   r   )r+   settingss     r   sreprrU  P  s     x ((..r0   N)__doc__
__future__r   typingr   sympy.core.functionr   sympy.core.mulr   mpmath.libmpr   r   r   printerr
   r   r   rU  rn   r0   r   <module>r]     sF    #  ,  8 ,|.' |.|	 / /r0   