
    Цi                       S r SSKJr  SSKJr  SSKJrJrJrJ	r	J
r
J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  S
SKJrJr  S
SKJrJr  SSKJrJr   " S S\5      r\" \5      S 5       r  " S S\5      r!\" \!5      S 5       r"g)zI
A Printer for generating readable representation of most SymPy classes.
    )annotations)Any)SRationalPowBasicMulNumber)_keep_coeff)Integer)
Relational)default_sort_key)sift   )
precedence
PRECEDENCE)Printerprint_function)prec_to_dpsto_strc                  |   \ rS rSr% SrSSSSSSSS.rS\S	'   0 rS
\S'   SS jrSS jr	S r
SS 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* r&S+ r'S, r(S- r)S. r*S/ r+S0 r,S1 r-S2 r.S3 r/S4 r0S5 r1S6 r2S7 r3S8 r4S9 r5S: r6S; r7S< r8S= r9S> r:S? r;S@ r<SA r=SB r>SC r?SD r@SE rASF rBSG rCSH rDSI rESJ rFSK rGSL rHSM rISN rJSO rKSP rLSQ rMSR rNSSS jrOST rPSU rQSV rRSW rSSX rTSY rUSZ rVS[ rWS\ rXS] rYS^ rZS_ r[S` r\Sa r]Sb r^Sc r_Sd r`Se raSf rbSg rcSh rdSi reSj rfSk rgSl rhSm riSn rjSo rk\krl\krmSp rnSq roSr rpSs rqSt rrSu rsSv rtSw ruSx rvSy rwSz rxS{ ryS| rzS} r{S~ r|S r}S r~S rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rSrg)
StrPrinter   	_sympystrNautoFT)order	full_precsympy_integersabbrevperm_cyclicminmaxzdict[str, Any]_default_settingszdict[str, str]_relationalsc                    [        U5      U:  d  U(       d#  [        U5      U::  a  SU R                  U5      -  $ U R                  U5      $ )N(%s))r   _print)selfitemlevelstricts       Q/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/sympy/printing/str.pyparenthesizeStrPrinter.parenthesize"   s@    tu$v:d;Ku;TDKK---;;t$$    c           	     l    UR                  U Vs/ s H  o@R                  XC5      PM     sn5      $ s  snf N)joinr-   )r(   argssepr*   r)   s        r,   	stringifyStrPrinter.stringify(   s,    xxDIDD**47DIJJIs   1c                    [        U[        5      (       a  U$ [        U[        5      (       a  [        U5      $ [        U5      $ r1   )
isinstancestrr   reprr(   exprs     r,   emptyPrinterStrPrinter.emptyPrinter+   s5    dC  Ke$$:t9r/   c                   U R                  XS9n[        U5      n/ nU H  nU R                  U5      nUR                  S5      (       a  UR                  (       d  SnUSS  nOSn[        U5      U:  d  UR                  (       a  UR                  USU-  /5        M}  UR                  X/5        M     UR                  S5      nUS:X  a  SnUSR                  U5      -   $ )	Nr   -r   +r&   r     )_as_ordered_termsr   r'   
startswithis_Addextendpopr2   )	r(   r<   r   termsprecltermtsigns	            r,   
_print_AddStrPrinter._print_Add3   s    &&t&9$DD!A||C  abE$$&$++$
+,$#  uuQx3;Dchhqk!!r/   c                    g)NTrue r;   s     r,   _print_BooleanTrueStrPrinter._print_BooleanTrueH   s    r/   c                    g)NFalserT   r;   s     r,   _print_BooleanFalseStrPrinter._print_BooleanFalseK       r/   c                T    SU R                  UR                  S   [        S   5      -  $ )Nz~%sr   Not)r-   r3   r   r;   s     r,   
_print_NotStrPrinter._print_NotN   s'    t((1j6GHIIr/   c                J   [        UR                  5      n[        U5       Hf  u  p4[        U[        5      (       d  M  UR
                  R                  [        R                  L d  ME  UR                  SUR                  U5      5        Mh     U R                  US[        S   5      $ )Nr   z & 
BitwiseAnd)listr3   	enumerater8   r   	canonicalrhsr   NegativeInfinityinsertrI   r5   r   )r(   r<   r3   jis        r,   
_print_AndStrPrinter._print_AndQ   sr    DIIdODA!Z((KKOOq'9'99Atxx{+ $ ~~dE:l+CDDr/   c                J    U R                  UR                  S[        S   5      $ )Nz | 	BitwiseOrr5   r3   r   r;   s     r,   	_print_OrStrPrinter._print_OrY   s    ~~dii
;0GHHr/   c                J    U R                  UR                  S[        S   5      $ )Nz ^ 
BitwiseXorrn   r;   s     r,   
_print_XorStrPrinter._print_Xor\   s    ~~dii
<0HIIr/   c                |    U R                  UR                  5      < SU R                  UR                  S5      < S3$ N(, ))r'   functionr5   	argumentsr;   s     r,   _print_AppliedPredicate"StrPrinter._print_AppliedPredicate_   s/    KK&t~~t(LN 	Nr/   c                    UR                    Vs/ s H  o R                  U5      PM     nnUR                  R                  SSR	                  U5      -  -   $ s  snf Nr&   rx   )r3   r'   	__class____name__r2   )r(   r<   orL   s       r,   _print_BasicStrPrinter._print_Basicc   sG    %)YY/Y[[^Y/~~&&$))A,)>>> 0s   Ac                    UR                   R                  S:X  a  U R                  UR                   S   5        U R                  UR                   5      $ )N)r   r   )r   r   )blocksshaper'   )r(   Bs     r,   _print_BlockMatrixStrPrinter._print_BlockMatrixg   s9    88>>V#KK'{{188$$r/   c                    g)NCatalanrT   r;   s     r,   _print_CatalanStrPrinter._print_Catalanl   s    r/   c                    g)NzoorT   r;   s     r,   _print_ComplexInfinity!StrPrinter._print_ComplexInfinityo       r/   c                   [        UR                  UR                  4 Vs/ s H  o R                  U5      PM     sn5      nUR                  [
        R                  L a  SU-  $ X0R                  UR                  5      4-  nSU-  $ s  snf )NzConditionSet(%s, %s)zConditionSet(%s, %s, %s))tuplesym	conditionr'   base_setr   UniversalSet)r(   sri   r3   s       r,   _print_ConditionSetStrPrinter._print_ConditionSetr   st    quuakk.BC.Bkk!n.BCD::')D00QZZ(**)D00	 Ds   Bc                   ^  UR                   nUR                   Vs/ s H  o3S   S:X  a  US   OUPM     nnSSR                  U 4S jU/U-    5       5      -  $ s  snf )Nr   r   zDerivative(%s)rx   c              3  F   >#    U  H  nTR                  U5      v   M     g 7fr1   r'   .0argr(   s     r,   	<genexpr>/StrPrinter._print_Derivative.<locals>.<genexpr>|   s     ,Y#T[[-=-=   !)r<   variable_countr2   )r(   r<   dexprri   dvarss   `    r,   _print_DerivativeStrPrinter._print_Derivativey   s`    		373F3FG3Fa11)3FG$)),Y%SX,Y"ZZZ Hs   Ac                    [        UR                  5       [        S9n/ nU H=  nU R                  U5      < SU R                  X   5      < 3nUR	                  U5        M?     SSR                  U5      -  $ )Nkeyz: {%s}rx   )sortedkeysr   r'   appendr2   )r(   dr   itemsr   r)   s         r,   _print_dictStrPrinter._print_dict~   sd    affh$45C#{{3/QV1DEDLL  		%(((r/   c                $    U R                  U5      $ r1   )r   r;   s     r,   _print_DictStrPrinter._print_Dict       %%r/   c                @   [        US5      (       a"  SU R                  UR                  5       5      -   $ [        US5      (       a=  SU R                  UR                  5      -   S-   U R                  UR                  5      -   $ SU R                  UR                  5      -   $ )N
as_booleanzDomain: setz in z
Domain on )hasattrr'   r   symbolsr   )r(   r   s     r,   _print_RandomDomainStrPrinter._print_RandomDomain   s    1l##ALLN ;;;QQYY!77&@KK&' (  $++aii"888r/   c                     SUR                   -   $ N_namer;   s     r,   _print_DummyStrPrinter._print_Dummy   s    TYYr/   c                    g)N
EulerGammarT   r;   s     r,   _print_EulerGammaStrPrinter._print_EulerGamma   s    r/   c                    g)NErT   r;   s     r,   _print_Exp1StrPrinter._print_Exp1       r/   c                |    SU R                  UR                  5      < SU R                  UR                  5      < S3$ rv   )r'   r<   condr;   s     r,   _print_ExprCondPairStrPrinter._print_ExprCondPair   s'    ![[3T[[5KLLr/   c                n    UR                   R                  SU R                  UR                  S5      -  -   $ r   )funcr   r5   r3   r;   s     r,   _print_FunctionStrPrinter._print_Function   s+    yy!!FT^^DIIt-L$LLLr/   c                    g)NGoldenRatiorT   r;   s     r,   _print_GoldenRatioStrPrinter._print_GoldenRatio   s    r/   c                n    UR                   R                  SU R                  UR                  S5      -  -   $ r   )r   r   r5   pargsr;   s     r,   _print_HeavisideStrPrinter._print_Heaviside   s-     yy!!FT^^DJJ-M$MMMr/   c                    g)NTribonacciConstantrT   r;   s     r,   _print_TribonacciConstant$StrPrinter._print_TribonacciConstant   s    #r/   c                    gNIrT   r;   s     r,   _print_ImaginaryUnitStrPrinter._print_ImaginaryUnit   r   r/   c                    g)NoorT   r;   s     r,   _print_InfinityStrPrinter._print_Infinity       r/   c                   ^  U 4S jnSR                  UR                   Vs/ s H
  o2" U5      PM     sn5      nST R                  UR                  5      < SU< S3$ s  snf )Nc                   > [        U 5      S:X  a  TR                  U S   5      $ TR                  U S   4[        U SS  5      -   5      $ Nr   r   lenr'   r   xabr(   s    r,   
_xab_tostr.StrPrinter._print_Integral.<locals>._xab_tostr   E    3x1}{{3q6**{{CF9uSW~#=>>r/   rx   z	Integral(ry   r2   limitsr'   rz   r(   r<   r   rL   Ls   `    r,   _print_IntegralStrPrinter._print_Integral   sL    	?
 IIdkk:kz!}k:;%)[[%?CC ;   Ac                `   SnUR                   u  p4pVUR                  (       a  UR                  (       a  SnOdUR                  (       a
  U(       d  SnOIUR                  (       a
  U(       d  SnO.U(       d
  U(       d  SnOU(       a
  U(       a  SnOU(       a  SnOSnUR                  " S0 X4US.D6$ )NzInterval{m}({a}, {b})rC   z.openz.Lopenz.Ropen)abmrT   )r3   is_infiniteformat)r(   ri   finr  r  rL   rr  s           r,   _print_IntervalStrPrinter._print_Interval   sz    &VV
a==Q]]A]]1A]]1A1A1AAAzz5!!455r/   c                |    SU R                  UR                  5      < SU R                  UR                  5      < S3$ )NzAccumBounds(rx   ry   )r'   r!   r"   )r(   ri   s     r,   _print_AccumulationBounds$StrPrinter._print_AccumulationBounds   s,    (,AEE(:(,AEE(:< 	<r/   c                N    SU R                  UR                  [        S   5      -  $ )Nz%s**(-1)r   r-   r   r   )r(   r   s     r,   _print_InverseStrPrinter._print_Inverse   s#    D--aeeZ5FGGGr/   c                    UR                   nUR                  n[        U5      S:X  a  US   R                  (       a  US   nSU R	                  U5      < SU R	                  U5      < S3$ )Nr   r   zLambda(rx   ry   )r<   	signaturer   	is_symbolr'   )r(   objr<   sigs       r,   _print_LambdaStrPrinter._print_Lambda   sR    xxmms8q=SV--a&C#';;s#3T[[5FGGr/   c                   ^  [        UR                  [        S9nUR                  R                  SSR                  U 4S jU 5       5      -  -   $ )Nr   r&   rx   c              3  F   >#    U  H  nTR                  U5      v   M     g 7fr1   r   r   s     r,   r   .StrPrinter._print_LatticeOp.<locals>.<genexpr>   s     6XSWCt{{37G7GSWr   )r   r3   r   r   r   r2   r(   r<   r3   s   `  r,   _print_LatticeOpStrPrinter._print_LatticeOp   s>    dii%56yy!!FTYY6XSW6X-X$XXXr/   c           
     h    UR                   u  p#pES[        [        U R                  X#XE45      5      -  $ )NzLimit(%s, %s, %s, dir='%s'))r3   r   mapr'   )r(   r<   ezz0dirs         r,   _print_LimitStrPrinter._print_Limit   s.    		b,uSqRo5V/WWWr/   c                ,    SU R                  US5      -  $ )N[%s]rx   )r5   r;   s     r,   _print_listStrPrinter._print_list   s    tT222r/   c                $    U R                  U5      $ r1   )r(  r;   s     r,   _print_ListStrPrinter._print_List   r   r/   c                $    UR                  U 5      $ r1   )_format_strr;   s     r,   _print_MatrixBaseStrPrinter._print_MatrixBase   r   r/   c                    U R                  UR                  [        S   SS9SU R                  UR                  5      < SU R                  UR
                  5      < S3-   $ )NAtomTr+   [rx   ])r-   parentr   r'   ri   rh   r;   s     r,   _print_MatrixElementStrPrinter._print_MatrixElement   sN      j.@ N KK/TVV1DEF 	Fr/   c                  ^  U 4S jnT R                  UR                  [        S   SS9S-   U" UR                  UR                  R                  5      -   S-   U" UR
                  UR                  R                  5      -   S-   $ )Nc                   > [        U 5      n U S   S:X  a  U S	 U S   S:X  a  SU S'   U S   U:X  a  SU S'   SR                  U4S jU  5       5      $ )N   r   r   rC   :c              3  F   >#    U  H  nTR                  U5      v   M     g 7fr1   r   r   s     r,   r   BStrPrinter._print_MatrixSlice.<locals>.strslice.<locals>.<genexpr>   s     ;#T[[--r   )rb   r2   )xdimr(   s     r,   strslice/StrPrinter._print_MatrixSlice.<locals>.strslice   s[    QAtqyaDtqy!ts{!88;;<<r/   r2  Tr3  r4  rx   r5  )r-   r6  r   rowslicerowscolslicecols)r(   r<   rA  s   `  r,   _print_MatrixSliceStrPrinter._print_MatrixSlice   s    	= !!$++z&/A$!ORUU(8(89:<@A(8(89:<?@ 	Ar/   c                    UR                   $ r1   r   r;   s     r,   _print_DeferredVector StrPrinter._print_DeferredVector      yyr/   c           
     &   [        U5      nUR                  nUS   [        R                  L d  [	        S USS   5       5      (       Ga  [        US SS9u  pE[        U5       H  u  pgUR                  R                  (       a  UR                  * nO>[        UR                  R                  5      n	U	S   * U	S'   [        R                  " U	5      nUS-
  (       a  [        UR                  USS9OUR                  XF'   M     / n
U(       aM  US   R                  (       d9  US   R                  5       (       a!  U R!                  UR#                  S5      5      /n
U
U Vs/ s H  nU R%                  XSS	9PM     sn-   nU(       d  S
/n['        U5      S:  a:  US   R                  5       (       a"  U R!                  UR#                  S5      5      /n
O/ n
U
U Vs/ s H  nU R%                  XSS	9PM     sn-   nSR)                  U5      nSR)                  U5      n['        U5      S:  a
  U< SU< S3$ U(       a	  U< SU< 3$ U$ UR+                  5       u  pUS:  a  [-        U* U5      nSnOSn/ n/ n/ nU R.                  S;  a  UR1                  5       nO[        R2                  " U5      nS nU GH  nUR4                  (       a  [7        U[        5      (       a  [9        UR                  R+                  5       S   S:  5      (       a  UR                  [        R:                  La  UR=                  U" U5      5        M  ['        UR                  S   R                  5      S:w  a6  [7        UR                  [        [        45      (       a  UR=                  U5        UR=                  UR                  5        GM  UR>                  (       a  U[        R@                  Lan  URB                  S:w  a$  UR=                  [E        URB                  5      5        URF                  S:w  a'  UR=                  [E        URF                  5      5        GM  GM  UR=                  U5        GM     U=(       d    [        R                  /nU Vs/ s H  nU R%                  UUSS	9PM     nnU Vs/ s H  nU R%                  UUSS	9PM     nnU HR  nUR                  U;   d  M  SUURI                  UR                  5         -  UURI                  UR                  5      '   MT     U(       d  USR)                  U5      -   $ ['        U5      S:X  a  USR)                  U5      -   S-   US   -   $ USR)                  U5      -   SSR)                  U5      -  -   $ s  snf s  snf s  snf s  snf )Nr   c              3     #    U  HK  n[        U[        5      =(       d/    UR                  =(       a    [        S  UR                   5       5      v   MM     g7f)c              3  8   #    U  H  oR                   v   M     g 7fr1   )
is_Integer)r   ais     r,   r   2StrPrinter._print_Mul.<locals>.<genexpr>.<genexpr>  s      @2s   N)r8   r
   is_Powallr3   )r   r  s     r,   r   (StrPrinter._print_Mul.<locals>.<genexpr>  sG      ## "A 1f% A@S @ @@A!s   AAr   c                    [        U [        5      =(       a)    [        U R                  R	                  5       S   S:  5      $ Nr   )r8   r   boolexpas_coeff_Mul)r?  s    r,   <lambda>'StrPrinter._print_Mul.<locals>.<lambda>  s0    1c"HtAEE,>,>,@,Ca,G'HHr/   T)binaryFevaluater3  1*z/(ry   /rA   rC   )oldnonec                D   U R                  5       u  p[        [        R                  " U5      5      nUS   [        R
                  L a  USS  nO	US   * US'   [        R                  " U5      n[        U [        5      (       a  U R                  XSS9$ U R                  USS9$ )Nr   r   Fr^  )
as_base_exprb   r	   	make_argsr   NegativeOne
_from_argsr8   r   r   )ri   r  r   eargss       r,   apow#StrPrinter._print_Mul.<locals>.apowK  s    ==?DAq)*EQx1==(ab	!!H9au%A!S!!vvaUv3366!e6,,r/   r&   z/(%s))%r   r3   r   Oneanyr   rc   rY  	is_Numberrb   r	   ri  r   baserG   could_extract_minus_signr'   rI   r-   r   r2   rZ  r   r   as_ordered_factorsrg  is_commutativer8   rX  rh  r   is_RationalInfinitypr   qindex)r(   r<   rK   r3   r   nri   dir   dargsprer  nfactorsdfactorscrO   r  	pow_parenrk  r)   r?  a_strb_strs                          r,   
_print_MulStrPrinter._print_Mul  s   $ yy7aees ## ab##  #  #  IDA #166##A -E %ayE!Hu-A:;a%s277A6RWW & C11)F)F)H)H{{1558,-A #///F H5 1vzad;;=={{1558,-A #///F H "A"A8}q $%q))"#Q''H  "q5r1%DDD	::_,**,D ==&D
	- D##tS))..03a788881==0HHT$Z(DIIaL--.!3&tyy3*==!((.HHTYY'!!d!**&<66Q;HHXdff-.66Q;HHXdff-.  % ( L!%%CDE1a""1d5"91ECDE1a""1d5"91E DyyA~,2U177499;M5N,Naggdii()  #((5/))Vq[#((5/)C/%(::#((5/)Gchhuo,EEEm~ FEs   U?V9V	Vc                   UR                  5       u  p#SnUR                  (       au  UR                  5       u  pVUR                  (       a!  UR                  (       a  [        U* U5      nSnO1UR                  (       a   UR                  (       a  [        U* U5      nSnUSR                  UR                   Vs/ s H  opR                  U[        U5      5      PM     sn5      -   $ s  snf )NrC   rA   ra  )
as_coeff_mmul	is_numberas_real_imagis_zerois_negativer   r2   r3   r-   r   )r(   r<   r  r  rO   reimr   s           r,   _print_MatMulStrPrinter._print_MatMul{  s    !!#;;^^%FBzzbnn"A2q)"A2q)chhAEK#sJt$45K
 
 	
Ks   5$C"
c                l    SR                  UR                  U R                  UR                  5      5      $ )Nz{}.({}))r  rz   r'   r<   r;   s     r,   _print_ElementwiseApplyFunction*StrPrinter._print_ElementwiseApplyFunction  s,    MMKK		"
 	
r/   c                    g)NnanrT   r;   s     r,   
_print_NaNStrPrinter._print_NaN  r   r/   c                    g)Nz-oorT   r;   s     r,   _print_NegativeInfinity"StrPrinter._print_NegativeInfinity  r   r/   c                p   UR                   (       a!  [        S UR                   5       5      (       ae  [        UR                   5      S::  a  SU R	                  UR
                  5      -  $ SU R                  UR
                  4UR                   -   SS5      -  $ SU R                  UR                  SS5      -  $ )Nc              3  D   #    U  H  o[         R                  L v   M     g 7fr1   )r   Zero)r   rv  s     r,   r   *StrPrinter._print_Order.<locals>.<genexpr>  s     $E*Q!&&[*s    r   zO(%s)rx   r   )	variablesrT  pointr   r'   r<   r5   r3   r;   s     r,   _print_OrderStrPrinter._print_Order  s    ~~$E$**$E!E!E4>>"a'TYY!777t~~0MtUV!WWWT^^DIItQ???r/   c                "    UR                  5       $ r1   __str__r;   s     r,   _print_OrdinalStrPrinter._print_Ordinal      ||~r/   c                "    UR                  5       $ r1   r  r;   s     r,   _print_CycleStrPrinter._print_Cycle  r  r/   c                h   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(       a  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UR                  SS5      nU$ UR                  5       nU(       dL  UR                  S:  a  SU R                  UR                  5      -  $ SU R                  UR                  5      -  $ U R                  UR                  S US   S-    5      SU R                  UR                  5      -  -   nU R                  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()r   r  rw   ,rC      zPermutation(%s)zPermutation([], size=%s)z	, size=%s) sympy.combinatorics.permutationsr  r  sympy.utilities.exceptionsr  print_cyclic	_settingsgetsize__repr__r   rfindreplacesupportr'   
array_form)r(   r<   r  r  r  r    r   lasttrimusefulls              r,   _print_PermutationStrPrinter._print_Permutation  s   GH!.."%++6- 8 */+P ..,,]DAK99 dDIIM*335c'lmDA773<D19AeH!4eHq$x'		#r"AHA99q=,t{{4??/KKK1DKK		4JJJ;;tz"	:;kDKKX\XaXaLb>bbDT__55C4y3t9$$s**r/   c                    UR                   u  p#n[        UR                  5      S:X  a
  US   nUS   nSU R                  U5      < SU R                  U5      < SU R                  U5      < S3$ )Nr   r   zSubs(rx   ry   )r3   r   r  r'   )r(   r  r<   rc  news        r,   _print_SubsStrPrinter._print_Subs  s`    3syy>Qa&Ca&CKKt{{3/S1AC 	Cr/   c                "    UR                  5       $ r1   r   r;   s     r,   _print_TensorIndexStrPrinter._print_TensorIndex      {{}r/   c                "    UR                  5       $ r1   r   r;   s     r,   _print_TensorHeadStrPrinter._print_TensorHead  r  r/   c                "    UR                  5       $ r1   r   r;   s     r,   _print_TensorStrPrinter._print_Tensor  r  r/   c                    UR                  5       u  p#USR                  U Vs/ s H  o@R                  U[        U5      5      PM     sn5      -   $ s  snf )Nra  )!_get_args_for_traditional_printerr2   r-   r   )r(   r<   rO   r3   r   s        r,   _print_TensMulStrPrinter._print_TensMul  sO    ;;=
chhAEF#sJt$45F
 
 	
Fs   $A
c                "    UR                  5       $ r1   r   r;   s     r,   _print_TensAddStrPrinter._print_TensAdd  r  r/   c                8    U R                  UR                  5      $ r1   r'   r   r;   s     r,   _print_ArraySymbolStrPrinter._print_ArraySymbol  s    {{499%%r/   c           
         U R                  UR                  [        S   S5      < SSR                  UR                   Vs/ s H  o R                  U5      PM     sn5      < S3$ s  snf )NFuncTr4  rx   r5  )r-   r   r   r2   indicesr'   )r(   r<   ri   s      r,   _print_ArrayElementStrPrinter._print_ArrayElement  sW    diiF);TBDIIgkgsgsNtgsbc{{[\~gsNtDuw 	wNts    A%c                    UR                    Vs/ s H  nSU R                  U5      -  PM     nnSSR                  U5      -  $ s  snf )Nz    %szPermutationGroup([
%s])z,
)r3   r'   r2   )r(   r<   r  rv  s       r,   _print_PermutationGroup"StrPrinter._print_PermutationGroup  s?    04		:	1XA&	:)EJJqM99 ;s   Ac                    g)NpirT   r;   s     r,   	_print_PiStrPrinter._print_Pi  r   r/   c                   ^  SSR                  U 4S jUR                   5       5      < ST R                  UR                  5      < ST R                  UR                  5      < S3$ )NzPolynomial ring in rx   c              3  F   >#    U  H  nTR                  U5      v   M     g 7fr1   r   )r   rsr(   s     r,   r   -StrPrinter._print_PolyRing.<locals>.<genexpr>  s     ?,BB,r    over  with  orderr2   r   r'   domainr   )r(   rings   ` r,   _print_PolyRingStrPrinter._print_PolyRing  sB    YY?$,,?@KK$dkk$**&=? 	?r/   c                   ^  SSR                  U 4S jUR                   5       5      < ST R                  UR                  5      < ST R                  UR                  5      < S3$ )NzRational function field in rx   c              3  F   >#    U  H  nTR                  U5      v   M     g 7fr1   r   )r   fsr(   s     r,   r   .StrPrinter._print_FracField.<locals>.<genexpr>   s     @-BB-r   r  r  r  r  r(   fields   ` r,   _print_FracFieldStrPrinter._print_FracField  sD    YY@%--@AKK%t{{5;;'?A 	Ar/   c                "    UR                  5       $ r1   r  )r(   elms     r,   _print_FreeGroupElement"StrPrinter._print_FreeGroupElement  s    {{}r/   c                @    SUR                   < SUR                  < S3$ )Nrw    + z*I))r?  yr(   polys     r,   _print_GaussianElement!StrPrinter._print_GaussianElement  s     $//r/   c                2    UR                  U [        SS5      $ )Nz%s**%sra  )r9   r   r  s     r,   _print_PolyElementStrPrinter._print_PolyElement	  s    xxj(C88r/   c                    UR                   S:X  a  U R                  UR                  5      $ U R                  UR                  [        S   SS9nU R                  UR                   [        S   SS9nUS-   U-   $ )Nr   r	   Tr3  r2  rb  )denomr'   numerr-   r   )r(   fracr  r  s       r,   _print_FracElementStrPrinter._print_FracElement  so    ::?;;tzz**%%djj*U2CD%QE%%djj*V2DT%RE3;&&r/   c                   [         S   S-
  n/ UR                   Vs/ s H  o0R                  X25      PM     nnnUR                  5        GHh  u  pg/ n[	        U5       HA  u  pU
S:  d  M  U
S:X  a  UR                  XY   5        M(  UR                  XY   SU
-  -   5        MC     SR                  U5      nUR                  (       a1  U(       a  SU R                  U5      -   S-   nO{U R                  U5      nOiU(       aQ  U[        R                  L a  UR                  SU/5        M  U[        R                  L a  UR                  S	U/5        GM  U R                  U5      nU(       d  UnOUS-   U-   nUR                  S	5      (       a  UR                  S	USS  /5        GMU  UR                  SU/5        GMk     US   S
;   a"  UR                  S5      nUS	:X  a  S	US   -   US'   UR                  R                   S-   nSSKJn   USUR'                  5       -  -  nUS-  n[	        U5       HM  u  nn[+        U5      S:  d  M  US S S:X  d  M"  U[+        U5      S-
  S  S:X  d  M9  US[+        U5      S-
   UU'   MO     USR                  U5      SR                  U5      4-  $ s  snf ! U a    USUR)                  5       -  -  n Nf = f)Nr2  r   r   z**%dra  rw   ry   rB   rA   )rA   rB   z(%s, %s)PolynomialErrorz, modulus=%sz, domain='%s'r;  rD   rx   )r   gensr-   rJ   rc   r   r2   rG   r'   r   rm  rH   rh  rF   rI   r   r   sympy.polys.polyerrorsr  get_modulus
get_domainr   )r(   r<   	ATOM_PRECr   rJ   r  monomcoeffs_monomri   r   s_coeffs_termmodifierr  r  rx  r)   s                     r,   _print_PolyStrPrinter._print_Poly  s   v&*	TYYPY--a;YtP JJLLEG!%(q5Avtw/tw!';< ) hhw'G||!DKK$66<G"kk%0G~c7^4 -c7^4 ++e,  30  %%c6!":./c6]+K )N 8z!yy|H3q>a((94:	:nt'7'7'999F 	#$T?KE44y1}$r(c/d3t9q=>6Jc6Q"1SY]3U + %$))D/:::} Qj  	:o(999F	:s   JJ" "K Kc                    g)Nr   rT   )r(   rv  s     r,   _print_UniversalSetStrPrinter._print_UniversalSetV  s    r/   c                    UR                   (       a-  U R                  UR                  5       R                  5       5      $ U R                  UR                  5       5      $ r1   )
is_aliasedr'   as_polyas_exprr;   s     r,   _print_AlgebraicNumber!StrPrinter._print_AlgebraicNumberY  s<    ??;;t||~55788;;t||~..r/   c                  ^  [        U5      nUR                  [        R                  L a%  U(       d  ST R	                  UR
                  5      -  $ UR                  (       a  UR                  * [        R                  L a9  U(       d2  S[        U 4S j[        R                  UR
                  4 5       5      -  $ UR                  [        R                  * L a?  T R	                  [        R                  5      < ST R                  UR
                  USS9< 3$ T R                  UR                  USS9nT R                  S:X  ap  UR                  R                  (       aU  UR                  R                  S:w  a;  UR                  S	5      (       a%  T R                  UR
                  USS9< S
USS < 3$ T R                  UR
                  USS9< S
U< 3$ )aL  Printing helper function for ``Pow``

Parameters
==========

rational : bool, optional
    If ``True``, it will not attempt printing ``sqrt(x)`` or
    ``x**S.Half`` as ``sqrt``, and will use ``x**(1/2)``
    instead.

    See examples for additional details

Examples
========

>>> from sympy import sqrt, StrPrinter
>>> from sympy.abc import x

How ``rational`` keyword works with ``sqrt``:

>>> printer = StrPrinter()
>>> printer._print_Pow(sqrt(x), rational=True)
'x**(1/2)'
>>> printer._print_Pow(sqrt(x), rational=False)
'sqrt(x)'
>>> printer._print_Pow(1/sqrt(x), rational=True)
'x**(-1/2)'
>>> printer._print_Pow(1/sqrt(x), rational=False)
'1/sqrt(x)'

Notes
=====

``sqrt(x)`` is canonicalized as ``Pow(x, S.Half)`` in SymPy,
so there is no need of defining a separate printer for ``sqrt``.
Instead, it should be handled here as well.
zsqrt(%s)z%s/sqrt(%s)c              3  F   >#    U  H  nTR                  U5      v   M     g 7fr1   r   r   s     r,   r   (StrPrinter._print_Pow.<locals>.<genexpr>  s     -]J\3dkk#.>.>J\r   rb  Fr3  
_sympyreprr   z	(Rational**r  )r   rY  r   Halfr'   rp  rs  r   rm  r-   printmethodrt  rw  rF   )r(   r<   rationalPRECr   s   `    r,   
_print_PowStrPrinter._print_Pow_  si   L $88qvvhDII 666yAFF"8 %u-]155RVR[R[J\-]'^^^xxAEE6!"&++aee"4"&"3"3DIItE"3"RT T dhhU;|+0D0DWX ||K((#'#4#4TYYU#4#SUVWXY[U\]],,TYYU,KQOOr/   c                >    U R                  UR                  S   5      $ rW  r'   r3   r;   s     r,   _print_UnevaluatedExpr!StrPrinter._print_UnevaluatedExpr  s    {{499Q<((r/   c                    [        U5      nU R                  UR                  USS9< SU R                  UR                  USS9< 3$ )NFr3  r/  )r   r-   rp  rY  )r(   r<   r3  s      r,   _print_MatPowStrPrinter._print_MatPow  sJ    $,,TYYU,K**488T%*HJ 	Jr/   c                x    U R                   R                  SS5      (       a  SU-  $ [        UR                  5      $ )Nr   FzS(%s))r  r  r9   rv  r;   s     r,   _print_IntegerStrPrinter._print_Integer  s3    >>.66d##466{r/   c                    g)NIntegersrT   r;   s     r,   _print_IntegersStrPrinter._print_Integers      r/   c                    g)NNaturalsrT   r;   s     r,   _print_NaturalsStrPrinter._print_Naturals  rD  r/   c                    g)N	Naturals0rT   r;   s     r,   _print_Naturals0StrPrinter._print_Naturals0      r/   c                    g)N	RationalsrT   r;   s     r,   _print_RationalsStrPrinter._print_Rationals  rM  r/   c                    g)NRealsrT   r;   s     r,   _print_RealsStrPrinter._print_Reals  r[   r/   c                    g)N	ComplexesrT   r;   s     r,   _print_ComplexesStrPrinter._print_Complexes  rM  r/   c                    g)NEmptySetrT   r;   s     r,   _print_EmptySetStrPrinter._print_EmptySet  rD  r/   c                    g)NEmptySequencerT   r;   s     r,   _print_EmptySequenceStrPrinter._print_EmptySequence  s    r/   c                    [        U5      $ r1   r9   r;   s     r,   
_print_intStrPrinter._print_int      4yr/   c                    [        U5      $ r1   rc  r;   s     r,   
_print_mpzStrPrinter._print_mpz  rf  r/   c                   UR                   S:X  a  [        UR                  5      $ U R                  R	                  SS5      (       a  SUR                  < SUR                   < 3$ UR                  < SUR                   < 3$ )Nr   r   FzS(z)/rb  )rw  r9   rv  r  r  r;   s     r,   _print_RationalStrPrinter._print_Rational  sY    66Q;tvv;~~!!"2E::%)VVTVV44"ffdff--r/   c                    UR                   S:X  a  [        UR                  5      $ SUR                  UR                   4-  $ )Nr   z%d/%d)rw  r9   rv  r;   s     r,   _print_PythonRational StrPrinter._print_PythonRational  s3    66Q;tvv;dffdff---r/   c                    UR                   S:X  a  [        UR                  5      $ UR                  < SUR                   < 3$ Nr   rb  denominatorr9   	numeratorr;   s     r,   _print_FractionStrPrinter._print_Fraction  4    q t~~&&"nnd.>.>??r/   c                    UR                   S:X  a  [        UR                  5      $ UR                  < SUR                   < 3$ rq  rr  r;   s     r,   
_print_mpqStrPrinter._print_mpq  rw  r/   c                R   UR                   nUS:  a  SnO[        UR                   5      nU R                  S   SL a  SnO7U R                  S   SL a  SnO"U R                  S   S:X  a  U R                  S:  nSU R                  ;   a  U R                  S   OS nS	U R                  ;   a  U R                  S	   OS n[	        UR
                  UWXVS
9nUR                  S5      (       a	  SUSS  -   nOUR                  S5      (       a  SUSS  -   nUR                  S5      (       a  USS  nU$ )Nr  r   r   TFr   r   r!   r"   )strip_zeros	min_fixed	max_fixedz-.0z-0.   z.0z0.r;  rB   )_precr   r  _print_levelmlib_to_str_mpf_rF   )r(   r<   rK   dpsstriplowhighrvs           r,   _print_FloatStrPrinter._print_Float  s   zz!8Cdjj)C>>+&$.E^^K(E1E^^K(F2%%)E','>dnnU#D(-(?t~~e$TSes[==ABB]]4  12B==ABB	r/   c           
        SSSSSSSSS	.nUR                   U;   aL  X!R                      < S
U R                  UR                  5      < SU R                  UR                  5      < S3$ U R	                  UR                  [        U5      5      < SU R                  R                  UR                   5      =(       d    UR                   < SU R	                  UR                  [        U5      5      < 3$ )NEqNe
AssignmentAddAugmentedAssignmentSubAugmentedAssignmentMulAugmentedAssignmentDivAugmentedAssignmentModAugmentedAssignment)z==z!=z:=z+=z-=z*=z/=z%=rw   rx   ry   rD   )rel_opr'   lhsre   r-   r   r$   r  )r(   r<   charmaps      r,   _print_RelationalStrPrinter._print_Relational  s     *****	
 ;;'!#*;;#7TXX9N#';;txx#8: : "..txxD9IJ,,00=LL,,TXXz$7GHJ 	Jr/   c                T    SU R                  UR                  SS9UR                  4-  $ )NzCRootOf(%s, %d)lexr@   )rP   r<   rx  r;   s     r,   _print_ComplexRootOfStrPrinter._print_ComplexRootOf  s.     DOODIIeO$L$(JJ$0 0 	0r/   c                    U R                  UR                  SS9/nUR                  [        R                  La*  UR                  U R                  UR                  5      5        SSR                  U5      -  $ )Nr  r@   zRootSum(%s)rx   )rP   r<   funr   IdentityFunctionr   r'   r2   r  s      r,   _print_RootSumStrPrinter._print_RootSum  sY    		78881---KKDHH-.tyy..r/   c                   UR                   R                  nUR                   Vs/ s H  o0R                  X1R                  S9PM     nnSSR                  U5      -  nUR                   Vs/ s H  oPR                  U5      PM     nnSU R                  UR                  5      -  nSU R                  UR                  5      -  nU/U-   Xx/-   n	U< SSR                  U	5      < S3$ s  snf s  snf )Nr@   r'  rx   zdomain='%s'z
order='%s'rw   ry   )	r   r   exprsrP   r   r2   r  r'   r  )
r(   basisclsr   r  genr  r  r   r3   s
             r,   _print_GroebnerBasisStrPrinter._print_GroebnerBasis  s    oo&&DIKKPKSKK8KP5))-2ZZ9ZcS!Z9U\\!::t{{5;;77w~/		$00 Q :s   "C&+C+c                p   ^  [        U[        S9nSR                  U 4S jU 5       5      nU(       d  gSU-  $ )Nr   rx   c              3  F   >#    U  H  nTR                  U5      v   M     g 7fr1   r   r   r)   r(   s     r,   r   (StrPrinter._print_set.<locals>.<genexpr>+       =utT**ur   zset()r   )r   r   r2   r(   r   r   r3   s   `   r,   
_print_setStrPrinter._print_set(  s4    q./yy=u==}r/   c                   ^ ^ SSK Jm  [        U[        S9nSR	                  U 4S jU 5       5      n[        U4S jU 5       5      (       a  SR                  U5      $ SR                  U5      $ )	Nr   )	FiniteSetr   rx   c              3  F   >#    U  H  nTR                  U5      v   M     g 7fr1   r   r  s     r,   r   .StrPrinter._print_FiniteSet.<locals>.<genexpr>4  r  r   c              3  D   >#    U  H  oR                  T5      v   M     g 7fr1   )has)r   r)   r  s     r,   r   r  5  s     5utxx	""us    zFiniteSet({})z{{{}}})sympy.sets.setsr  r   r   r2   rn  r  )r(   r   r   r3   r  s   `   @r,   _print_FiniteSetStrPrinter._print_FiniteSet0  sX    -q./yy=u==5u555"))$//t$$r/   c                x   ^  [        U[        S9nSR                  U 4S jU 5       5      nSR                  U5      $ )Nr   rx   c              3  F   >#    U  H  nTR                  U5      v   M     g 7fr1   r   r   s     r,   r   .StrPrinter._print_Partition.<locals>.<genexpr><  s     ;UcS))Ur   zPartition({}))r   r   r2   r  r  s   `   r,   _print_PartitionStrPrinter._print_Partition9  s5    q./yy;U;;%%d++r/   c                :    U(       d  gSU R                  U5      -  $ )Nzfrozenset()zfrozenset(%s))r  r(   r   s     r,   _print_frozensetStrPrinter._print_frozenset?  s     !333r/   c                   ^  U 4S jnSR                  UR                   Vs/ s H
  o2" U5      PM     sn5      nST R                  UR                  5      < SU< S3$ s  snf )Nc                   > [        U 5      S:X  a  TR                  U S   5      $ TR                  U S   4[        U SS  5      -   5      $ r   r   r   s    r,   r   )StrPrinter._print_Sum.<locals>._xab_tostrE  r   r/   rx   zSum(ry   r   r   s   `    r,   
_print_SumStrPrinter._print_SumD  sL    	?
 IIdkk:kz!}k:; $DMM :A>> ;r   c                    UR                   $ r1   r   r;   s     r,   _print_SymbolStrPrinter._print_SymbolM  rL  r/   c                    gr   rT   r;   s     r,   _print_IdentityStrPrinter._print_IdentityR  r   r/   c                    g)N0rT   r;   s     r,   _print_ZeroMatrixStrPrinter._print_ZeroMatrixU  r   r/   c                    g)Nr`  rT   r;   s     r,   _print_OneMatrixStrPrinter._print_OneMatrixX  r   r/   c                     SUR                   -  $ )NzQ.%sr   r;   s     r,   _print_PredicateStrPrinter._print_Predicate[  s    		!!r/   c                    [        U5      $ r1   rc  r;   s     r,   
_print_strStrPrinter._print_str^  rf  r/   c                x    [        U5      S:X  a  SU R                  US   5      -  $ SU R                  US5      -  $ )Nr   z(%s,)r   r&   rx   )r   r'   r5   r;   s     r,   _print_tupleStrPrinter._print_tuplea  s;    t9>T[[a111DNN4666r/   c                $    U R                  U5      $ r1   )r  r;   s     r,   _print_TupleStrPrinter._print_Tupleg  s      &&r/   c                N    SU R                  UR                  [        S   5      -  $ )Nz%s.Tr   r  )r(   Ts     r,   _print_TransposeStrPrinter._print_Transposej  s#    ))!%%E1BCCCr/   c                |    SU R                  UR                  5      < SU R                  UR                  5      < S3$ )NzUniform(rx   ry   )r'   r  r  r;   s     r,   _print_UniformStrPrinter._print_Uniformm  s'    $(KK$7TVV9LMMr/   c                    U R                   R                  SS5      (       a  SUR                  -  $ SUR                  -  $ )Nr   Fz%s)r  r  r   r   r;   s     r,   _print_QuantityStrPrinter._print_Quantityp  s7    >>h..$++%%diir/   c           	         UR                    Vs/ s H  o R                  U[        S   SS9PM     nnUS   /[        USS  S5       VVs/ s H  u  p$US-   U-   PM     snn-   nSR	                  U5      $ s  snf s  snnf )	Nr	   Tr3  r   r   ijkra  r  )r3   r-   r   zipr2   )r(   r<   ri   r   rh   r  s         r,   _print_QuaternionStrPrinter._print_Quaternionu  s~    KO99U9aq*U"3DA9UqTF#aeU*;<*;$!aeAg*;<<zz!} V<s   !A4	A9c                    [        U5      $ r1   rc  r;   s     r,   _print_DimensionStrPrinter._print_Dimensionz  rf  r/   c                     UR                   S-   $ r   r   r;   s     r,   _print_WildStrPrinter._print_Wild}      yy3r/   c                     UR                   S-   $ r   r   r;   s     r,   _print_WildFunctionStrPrinter._print_WildFunction  r  r/   c                    UR                   $ r1   r   r;   s     r,   _print_WildDotStrPrinter._print_WildDot  rL  r/   c                    UR                   $ r1   r   r;   s     r,   _print_WildPlusStrPrinter._print_WildPlus  rL  r/   c                    UR                   $ r1   r   r;   s     r,   _print_WildStarStrPrinter._print_WildStar  rL  r/   c                z    U R                   R                  SS5      (       a  gU R                  [        S5      5      $ )Nr   FzS(0)r   )r  r  r>  r   r;   s     r,   _print_ZeroStrPrinter._print_Zero  s2    >>.66""71:..r/   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$ rv   )r   r   r'   to_listdom)r(   rv  r  repr  s        r,   
_print_DMPStrPrinter._print_DMP  sD    kk""kk!))+&kk!%% "C--r/   c                    UR                   R                  nU R                  UR                  5      nU R                  UR                  5      nU R                  UR
                  5      nU< SU< SU< SU< S3$ rv   )r   r   r'   numdenr  )r(   r<   r  r  r  r  s         r,   
_print_DMFStrPrinter._print_DMF  sV    nn%%kk$((#kk$((#kk$((##&S#66r/   c                     SUR                   -  $ )NzObject("%s")r   )r(   r  s     r,   _print_ObjectStrPrinter._print_Object  s    ((r/   c                     SUR                   -  $ )NzIdentityMorphism(%s))r  r(   morphisms     r,   _print_IdentityMorphism"StrPrinter._print_IdentityMorphism  s    %77r/   c                \    SUR                   < SUR                  < SUR                  < S3$ )NzNamedMorphism(rx   z, "z"))r  codomainr   r  s     r,   _print_NamedMorphismStrPrinter._print_NamedMorphism  s#    !2!2HMMC 	Cr/   c                     SUR                   -  $ )NzCategory("%s")r   )r(   categorys     r,   _print_CategoryStrPrinter._print_Category  s    (--//r/   c                .    UR                   R                   $ r1   r   )r(   manifolds     r,   _print_ManifoldStrPrinter._print_Manifold  s    }}!!!r/   c                .    UR                   R                   $ r1   r   )r(   patchs     r,   _print_PatchStrPrinter._print_Patch  s    zzr/   c                .    UR                   R                   $ r1   r   )r(   coordss     r,   _print_CoordSystemStrPrinter._print_CoordSystem  s    {{r/   c                \    UR                   R                  UR                     R                  $ r1   
_coord_sysr   _indexr   r  s     r,   _print_BaseScalarField!StrPrinter._print_BaseScalarField  s#    ''5:::r/   c                b    SUR                   R                  UR                     R                  -  $ )Nze_%sr.  r  s     r,   _print_BaseVectorField!StrPrinter._print_BaseVectorField  s(    ((00>CCCCr/   c                    UR                   n[        US5      (       a0  SUR                  R                  UR                     R
                  -  $ SU R                  U5      -  $ )Nr/  zd%szd(%s))_form_fieldr   r/  r   r0  r   r'   )r(   diffr  s      r,   _print_DifferentialStrPrinter._print_Differential  sT      5,''5++33ELLAFFFFT[[///r/   c                N    S< SU R                  UR                  S   5      < S3$ )NTrrw   r   ry   r7  r;   s     r,   	_print_TrStrPrinter._print_Tr  s    TYYq\!:;;r/   c                8    U R                  UR                  5      $ r1   r  r  s     r,   
_print_StrStrPrinter._print_Str  s    {{166""r/   c                    UR                   nU R                  U5      < SU R                  UR                  5      < SU R                  UR                  5      < S3$ rv   )rz   r'   r  re   )r(   r<   rels      r,   _print_AppliedBinaryRelation'StrPrinter._print_AppliedBinaryRelation  sA    mm#{{3/#{{4884#{{48846 	6r/   rT   )F)r   r1   )r   
__module____qualname____firstlineno__r1  r#   __annotations__r$   r-   r5   r=   rP   rU   rY   r^   rj   ro   rs   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/  r7  rG  rJ  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)  r4  r8  r;  r>  rB  rG  rK  rP  rT  rX  r\  r`  rd  rh  rk  rn  ru  ry  r  r  r  r  r  r  r  r  r  r  r  _print_MatrixSymbol_print_RandomSymbolr  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+  r1  r4  r9  r=  r@  rD  __static_attributes__rT   r/   r,   r   r      s   K)~  $&L.%%K"*JEIJN?%
1[
)&9MMN
$D6&<HHYX
3&&FAtFl
"
@'+RC
&w:?
A
09'@;D/;Pz)J

..@@0J*0/1%,4
?''"7'DN 

/
.7)8C0" ;D0<#6r/   r   c                >    [        U5      nUR                  U 5      nU$ )a:  Returns the expression as a string.

For large expressions where speed is a concern, use the setting
order='none'. If abbrev=True setting is used then units are printed in
abbreviated form.

Examples
========

>>> from sympy import symbols, Eq, sstr
>>> a, b = symbols('a b')
>>> sstr(Eq(a + b, 0))
'Eq(a + b, 0)'
)r   doprintr<   settingsrv  r   s       r,   sstrrQ    s     " 	8A			$AHr/   c                  $    \ rS rSrSrS rS rSrg)StrReprPrinteri  z(internal) -- see sstrreprc                    [        U5      $ r1   )r:   r  s     r,   r  StrReprPrinter._print_str  s    Awr/   c                p    UR                   R                  < SU R                  UR                  5      < S3$ )Nrw   ry   )r   r   r'   r   r  s     r,   r@  StrReprPrinter._print_Str  s$    ;;//QVV1DEEr/   rT   N)r   rF  rG  rH  __doc__r  r@  rL  rT   r/   r,   rS  rS    s    $Fr/   rS  c                >    [        U5      nUR                  U 5      nU$ )zreturn expr in mixed str/repr form

i.e. strings are returned in repr form with quotes, and everything else
is returned in str form.

This function could be useful for hooking into sys.displayhook
)rS  rN  rO  s       r,   sstrreprrZ    s      	x A			$AHr/   N)#rX  
__future__r   typingr   
sympy.corer   r   r   r   r	   r
   sympy.core.mulr   sympy.core.numbersr   sympy.core.relationalr   sympy.core.sortingr   sympy.utilities.iterablesr   r   r   printerr   r   mpmath.libmpr   r   r  r   rQ  rS  rZ  rT   r/   r,   <module>re     s    #  ; ; & & , / * . , ;z6 z6z 
 ,FZ F   r/   