o
    jg[                     @   s8  d dl Z d dlZd dlZd dlmZ d dlmZmZmZ d dl	m
Z
mZ d dlmZ d dlmZmZmZmZ d dlmZmZmZmZmZmZmZmZmZmZ d dlmZm Z m!Z!m"Z"m#Z#m$Z$m%Z% d d	l&m'Z' d d
l(m)Z) d dl*m+Z+ d dl,m-Z-m.Z.m/Z/m0Z0m1Z1 d dl2m3Z3 d dl4m5Z5 d dl6m7Z8 d dl9m:Z: d dlm;Z; d dlm<Z< d dl=m>Z> e>dZ?ddhZ@ddhZAg ddfddZBdd ZCdd  ZDd!d" ZEd#d$ ZFd%d& ZGd'd( ZHd)d* ZId+d, ZJd-d. ZKd/d0 ZLd1d2 ZMed3d4 ZNd5d6 ZOd7d8 ZPd9d: ZQd d;lRmSZSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[m\Z\m]Z]m^Z^m_Z_m`Z`maZambZbmcZcmdZdmeZemfZfmgZgmhZhmiZimjZjmkZkmlZlmmZmmnZnmoZompZpmqZqmrZrmsZsmtZtmuZumvZvmwZwmxZxmyZymzZzm{Z{m|Z|m}Z}m~Z~mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ d<d= Zd d>lmZ d d?lmZ d d@lmZmZ d dAlmZmZmZmZ d dBlmZmZmZ dCdD Zd dElmZ dFdG Zd dHlmZ dIdJ Zd dKlmZmZ dLdM Zd dNlmZ dOdP Zd dQlmZ d dRlmZ dSdT ZedUdV ZedWdX Zd dYlmZ d dZlmZ d d[lmZ d d\lmZ d]d^ Zd_d` Zedadb Zdcdd Zdedf Zdgdh Zdidj Zdkdl Zdmdn Zdodp Zd dqlmZ d drlmZmZ d dslmZ d dtlmZmZ d dulmZ d dvlmZ dwdx Zedydz Zed{d| Zed}d~ Zd dlmZ d dlmZ dd Zd dlmZ d dlmZ dd Zdd Zdd Zdd ZdS )    N)meter)XFAILraisesignore_warnings)AtomBasic)SingletonRegistry)StrDummySymbolWild)
EIpioozoonanIntegerRationalFloatAlgebraicNumber)EqualityGreaterThanLessThan
RelationalStrictGreaterThanStrictLessThan
Unequality)Add)Mul)Pow)
DerivativeFunctionFunctionClassLambdaWildFunction)Interval)	vectorize)gmpy)SymPyDeprecationWarning)S)symbols)import_modulecloudpickle_assumptions_mhashis_EmptySetexpr_free_symbolsT c           	         s   t  trdD ]tt fdd qdtjtjddg}tr%|tg |D ]U|v r.q'tr=t  t	r8q' }nt
rK }n	tt }t }t|}t|t|ksfJ |siq'fdd}| || || | q'd	S )
z2 Check that pickling and copying round-trips.
    )r      c                      s   t  S N)pickledumpsr2   )aprotocolr2   [/var/www/html/zoom/venv/lib/python3.10/site-packages/sympy/utilities/tests/test_pickling.py<lambda>4   s    zcheck.<locals>.<lambda>         c              	      s   |D ]l}|t v rt| |rt||sJ |q|tv s| v rBtt t| |t||ks2J |W d    n1 s<w   Y  qt| |sHqt| |}t|dsnt||s[J |t|||ksnJ dt|||f qd S )N__call__z%s != %s, protocol: %s)not_equal_attrshasattrdeprecated_attrsr   r)   getattr)r7   bdiattr)
deprecatedr8   r2   r9   cO   s$   




&zcheck.<locals>.cN)
isinstancer   r   NotImplementedErrorcopydeepcopyr-   extendcallabletypeinspectismoduleloadsr6   r5   dirset)	r7   exclude
check_attrrG   	protocolsrC   d1d2rH   r2   )r7   rG   r8   r9   check.   s2   



rZ   c                  C   s&   t t  tt ttfD ]} t|  q
d S r4   )r   r   r   r*   rZ   rH   r2   r2   r9   test_core_basicg   s   
r\   c                   C   s   t td d S Nx)rZ   r	   r2   r2   r2   r9   test_core_Strk   s   r_   c                  C   s6   t t dddttdddttdfD ]} t|  qd S )Nr^   F)commutative_issue_3130)r
   r   r   rZ   r[   r2   r2   r9   test_core_symboln   s
   
rb   c                  C   sL   t dtddtdfD ]} t|  qtttdfD ]} t| dd qd S )Nr;   r<   z1.2FrV   )r   r   r   rZ   r   sqrtr[   r2   r2   r9   test_core_numbersw   s
   
re   c                  C   s   t dd } t|  d S )Nr^   g      ?)r   rZ   )yr2   r2   r9   test_core_float_copy~   s   rg   c                  C   sl   t d} t d}tt| |tt| |tt| |tt| |tt| |tt| |tt| |fD ]}t| q-d S )Nr^   rf   )	r   r   r   r   r   r   r   r   rZ   )r^   rf   rH   r2   r2   r9   test_core_relational   s   
rh   c                  C   (   t d} tt| dfD ]}t| qd S Nr^   r=   )r   r   rZ   r^   rH   r2   r2   r9   test_core_add      
rl   c                  C   ri   rj   )r   r   rZ   rk   r2   r2   r9   test_core_mul   rm   rn   c                  C   ri   rj   )r   r    rZ   rk   r2   r2   r9   test_core_power   rm   ro   c                  C   s.   t d} tt| ttttfD ]}t| qd S r]   )r   r!   r"   r#   r$   r%   rZ   )r^   fr2   r2   r9   test_core_function   s   
rq   c                  C   s.   t d} ttd}|t t| |d d S )Nrp      rU   )r"   listrangeappendr-   rZ   )rp   rU   r2   r2   r9   test_core_undefinedfunctions   s   
rw   c                  C   s   t d} t|  d S )Nrp   )r"   rZ   )rp   r2   r2   r9   !test_core_undefinedfunctions_fail   s   rx   c                  C   s    t t ddfD ]} t|  qd S )Nr   r;   )r&   rZ   r[   r2   r2   r9   test_core_interval   s   
ry   c                  C      t t dfD ]} t|  qd S )Nr   )r'   rZ   r[   r2   r2   r9   test_core_multidimensional      
r{   c                  C   s   g d} t j t jg}|dd | D 7 }tr|dd g7 }tdtdtdtdd	ttttt t	t
tjtjtjtjtjtjfD ]}|D ]
}|||u sMJ qCq?d S )
N)r   r3   r;   r<   r=   c                    s   g | ]  fd dqS )c                    s   t t |  S r4   )r5   rR   r6   r^   protor2   r9   r:      s    z,test_Singletons.<locals>.<listcomp>.<lambda>r2   ).0r2   r~   r9   
<listcomp>   s    z#test_Singletons.<locals>.<listcomp>c                 S   s   t t | S r4   )r-   rR   r6   r}   r2   r2   r9   r:      s    z!test_Singletons.<locals>.<lambda>r   r3   r;   )rK   rL   r-   r   r   r   r   r   r   r   r   r*   GoldenRatioTribonacciConstant
EulerGammaCatalanEmptySetIdentityFunction)rW   copiersobjfuncr2   r2   r9   test_Singletons   s    r   );	Piecewise
lowergammaacosh
chebyshevu
chebyshevtlnchebyshevt_rootlegendre	Heaviside	bernoullicothtanhassoc_legendresignargasin
DiracDeltarerfAbs
uppergammabinomialsinhcoscotacosacotgammabellhermiteharmonicLambertWzetalog	factorialasinhacothcoshdirichlet_etaEijkloggammaerfceilingim	fibonacci
tribonacci	conjugatetanchebyshevu_rootflooratanhrd   sinatanfflucasatan2	polygammaexpc                  C   sp  g t ttttttttt	t
ttttttttttttttttttttttt t!t"t#t$t%t&t't(t)R } t*t+t,t-t.t/t0t1t2t3t4f}t5d\}}}t6t7t8|||t9d|dk f|d |dkf|d dft:f}| D ]}t;| ||}t;| q|D ]}t;| |||}t;| q|D ]}t;| qd S )Nx,y,zr   r   r;   r3   r<   T)<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   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r+   r   r   r   r   r   rZ   )one_vartwo_varr^   rf   zothersclsrH   r2   r2   r9   test_functions   s   
&



r   )GeometryEntity)Point)CircleEllipse)LineLinearEntityRaySegment)PolygonRegularPolygonTrianglec                  C   s   t dd} t dd}t dd}t dd}tt t | tt| dtt| ddtt| |tt| |tt| |tt| |tt| |||t	t	| ddt
t
| ||fD ]}t|dd qMd S )	Nr3   r;   r<   r   r=   rr   Frc   )r   r   r   r   r   r   r   r   r   r   r   rZ   )p1p2p3p4rH   r2   r2   r9   test_geometry   s   



r   )Integralc                  C   s&   t d} tt| fD ]}t| q
d S r]   )r   r   rZ   rk   r2   r2   r9   test_integrals  s   
r   )Logicc                  C   rz   Nr3   )r   rZ   r[   r2   r2   r9   
test_logic  r|   r   )MatrixSparseMatrixc                  C   s>   t t g dttddgddggfD ]
} t| ddgd qd S )	Nr3   r;   r<   r3   r;   r<   r=   _smat_matrG   )r   r   rZ   r[   r2   r2   r9   test_matrices  s   (r   )Sievec                  C   s   t t  fD ]} t|  qd S r4   )r   rZ   r[   r2   r2   r9   test_ntheory$  s   
r   )Pauli)Unitc                  C   s"   t tttdfD ]} t|  qd S r   )r   r   r   rZ   r[   r2   r2   r9   test_physics-  s   
r   c                  C   s  ddl m} m} ddlm} ddlm}m} ddlm	}m
}m}m} ddlm}	 ddlm}
 ddlm} dd	lm} dd
lm} ddlm}m}m}m}m}m}m}m} ddl m!} ddl"m#} ddl$m%} | | dd||||||||||	|
||||||||||||||fD ]}t&| qd S )Nr   )ColorGradientColorScheme)ManagedWindow)Plot
ScreenShot)PlotAxesPlotAxesBasePlotAxesFramePlotAxesOrdinate)
PlotCamera)PlotController)	PlotCurve)PlotInterval)PlotMode)Cartesian2DCartesian3DCylindricalParametricCurve2DParametricCurve3DParametricSurfacePolar	Spherical)
PlotObject)PlotSurface)
PlotWindowg?g?)'&sympy.plotting.pygletplot.color_schemer   r   (sympy.plotting.pygletplot.managed_windowr   sympy.plotting.plotr   r   #sympy.plotting.pygletplot.plot_axesr   r   r   r   %sympy.plotting.pygletplot.plot_camerar   )sympy.plotting.pygletplot.plot_controllerr   $sympy.plotting.pygletplot.plot_curver   'sympy.plotting.pygletplot.plot_intervalr   #sympy.plotting.pygletplot.plot_moder   $sympy.plotting.pygletplot.plot_modesr   r   r   r   r  r  r  r  %sympy.plotting.pygletplot.plot_objectr  &sympy.plotting.pygletplot.plot_surfacer  %sympy.plotting.pygletplot.plot_windowr  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  rH   r2   r2   r9   test_plotting5  s.   (



r  c                  C   sN   ddl m}  ddlm} ddlm} t| d t|ddd t|  d S )	Nr   )r   )r   )r   rainbowr3   F)visible)r  r   r
  r   r  r   rZ   )r   r   r   r2   r2   r9   test_plotting2P  s   r  )ZZ)QQ)lex)Polyc                  C   sN   ddl m}  td}tt||fD ]}t| q| | |fD ]}t| qd S )Nr   )PurePolyr^   )sympy.polys.polytoolsr  r   r  rZ   )r  r^   rH   r2   r2   r9   test_pickling_polys_polytoolsm  s   

r  c                  C   s   ddl m} m}m} | | tdgtdgtdggtfD ]	}t|dgd q||tdtdgtdtdgftfD ]}t| q<||tdtdgtdtdtdgtfD ]}t| qZd S )Nr   )DMPDMFANPr3   r;   r<   repr   )sympy.polys.polyclassesr   r!  r"  r  rZ   r  )r   r!  r"  rH   r2   r2   r9   test_pickling_polys_polyclasses|  s   *.
2
r%  c                  C   s^   ddl m}  | dtt}| |fD ]
}t|ddgd q|j|jfD ]}t|ddgdd q!d S )Nr   )PolyRingr   r3   rs   F)rU   rV   )sympy.polys.ringsr&  r  r  rZ   dtypeone)r&  ringrH   r2   r2   r9   test_pickling_polys_rings  s   r+  c                   C   s   d S r4   r2   r2   r2   r2   r9   test_pickling_polys_fields  s   r,  c                  C   s,   ddl m}  | | ddfD ]}t| qd S )Nr   )PythonRationalr3      )"sympy.polys.domains.pythonrationalr-  rZ   )r-  rH   r2   r2   r9   test_pickling_polys_elements  s   
r0  c                  C   s  ddl m}  ddlm} | |  fD ]}t|dd q|| fD ]}t|dd qtd urTddlm} ddlm	} || fD ]}t|dd q=|| fD ]}t|dd qKddl
m} dd	lm} ||ttd
fD ]}t|dd qi|| fD ]}t|dd qwd S )Nr   )PythonIntegerRing)PythonRationalFieldFrc   )GMPYIntegerRing)GMPYRationalField)AlgebraicField)ExpressionDomainr<   )%sympy.polys.domains.pythonintegerringr1  'sympy.polys.domains.pythonrationalfieldr2  rZ   _gmpy#sympy.polys.domains.gmpyintegerringr3  %sympy.polys.domains.gmpyrationalfieldr4  "sympy.polys.domains.algebraicfieldr5  $sympy.polys.domains.expressiondomainr6  r  rd   )r1  r2  rH   r3  r4  r5  r6  r2   r2   r9   test_pickling_polys_domains  s(   

r>  c                  C   s   ddl m} m}m}m} | |  fD ]}t| q|| fD ]}t| q|| fD ]}t| q)|||  fD ]}t| q7d S )Nr   )LexOrderGradedLexOrderReversedGradedLexOrderInverseOrder)sympy.polys.orderingsr?  r@  rA  rB  rZ   )r?  r@  rA  rB  rH   r2   r2   r9   test_pickling_polys_orderings  s   


	
rD  c                  C   s^   ddl m} m} td\}}}| | dfD ]}t| q||d|||ffD ]}t| q&d S )Nr   )MonomialOpsMonomialr   r<   r   )sympy.polys.monomialsrE  rF  r+   rZ   )rE  rF  r^   rf   r   rH   r2   r2   r9   test_pickling_polys_monomials  s   

rH  c                  C   s"  ddl m} m}m}m}m}m}m}m}m	}m
}	m}
m}m}m}m}m}m}m}m} | |  fD ]}t| q/|| fD ]}t| q;|| fD ]}t| qG|| fD ]}t| qS|| fD ]}t| q_|| fD ]}t| qk|| fD ]}t| qw|| fD ]}t| q|| fD ]}t| q|	|	 fD ]}t| q|
|
 fD ]}t| q|| fD ]}t| q|| fD ]}t| q|| fD ]}t| q|| fD ]}t| q|| fD ]}t| q|| fD ]}t| q|| fD ]}t| q|| fD ]}t| qd S )Nr   )HeuristicGCDFailedHomomorphismFailedIsomorphismFailedExtraneousFactorsEvaluationFailedRefinementFailedCoercionFailedNotInvertibleNotReversibleNotAlgebraicDomainErrorPolynomialErrorUnificationFailedGeneratorsErrorGeneratorsNeededUnivariatePolynomialErrorMultivariatePolynomialErrorOptionError	FlagError)sympy.polys.polyerrorsrI  rJ  rK  rL  rM  rN  rO  rP  rQ  rR  rS  rT  rU  rV  rW  rX  rY  rZ  r[  rZ   )rI  rJ  rK  rL  rM  rN  rO  rP  rQ  rR  rS  rT  rU  rV  rW  rX  rY  rZ  r[  rH   r2   r2   r9   test_pickling_polys_errors  sP   T

















r]  c                  C   sd   ddl m} m} td}|d | d }| | |dfD ]}t| q|||tfD ]}t| q)d S )Nr   )CRootOfRootSumr^   r<   )sympy.polys.rootoftoolsr^  r_  r   rZ   r   )r^  r_  r^   rp   rH   r2   r2   r9   test_pickling_polys_rootoftools}  s   

ra  )LatexPrinter)MathMLContentPrinterMathMLPresentationPrinter)PrettyPrinter)
prettyForm
stringPict)Printer)PythonPrinterc                  C   s8   t t  ttttttdtt tt fD ]} t|  qd S )Nr7   )	rb  rc  rd  re  rf  rg  rh  ri  rZ   r[   r2   r2   r9   test_printing  s   
rj  c                   C      t t  d S r4   )rZ   rc  r2   r2   r2   r9   test_printing1     rl  c                   C   rk  r4   )rZ   rd  r2   r2   r2   r9   test_printing2  rm  rn  c                   C   rk  r4   )rZ   re  r2   r2   r2   r9   test_printing3  rm  ro  )Limit)Orderc                  C   s:   t d} t d}tt| |dtt| fD ]}t| qd S )Ner^   r3   )r   rp  rq  rZ   )rr  r^   rH   r2   r2   r9   test_series  s
   
rs  )Product)Sumc                  C   s>   t d} tt| | ddftt| | ddffD ]}t| qd S )Nr^   r;   r=   )r   rt  ru  rZ   rk   r2   r2   r9   test_concrete  s   (
rv  c                  C   s   t dddd} t|  d S )Nmessagez1.0zactive-deprecations)deprecated_since_versionactive_deprecations_target)r)   rZ   )wr2   r2   r9   test_deprecation_warning  s   r{  c                   C   s    t t tjtjksJ d S r4   )r5   rR   r6   r*   Halfr2   r2   r2   r9   test_issue_18438  s    r}  c                  C   s   d} t | tdksJ d S )Nsi   ^       sympy.core.powerPowsympy.core.numbersIntegerKR}bhHalf)R}bR}b.r;   )r5   rR   rd   )datar2   r2   r9   !test_unpickle_from_older_versions  s   r  )rP   rK   r5   sympy.physics.unitsr   sympy.testing.pytestr   r   r   sympy.core.basicr   r   sympy.core.singletonr   sympy.core.symbolr	   r
   r   r   sympy.core.numbersr   r   r   r   r   r   r   r   r   r   sympy.core.relationalr   r   r   r   r   r   r   sympy.core.addr   sympy.core.mulr   sympy.core.powerr    sympy.core.functionr!   r"   r#   r$   r%   sympy.sets.setsr&   sympy.core.multidimensionalr'   sympy.external.gmpyr(   r9  sympy.utilities.exceptionsr)   r*   r+   sympy.externalr,   r-   r?   rA   rZ   r\   r_   rb   re   rg   rh   rl   rn   ro   rq   rw   rx   ry   r{   r   sympy.functionsr   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   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rd   r   r   r   r   r   r   r   r   sympy.geometry.entityr   sympy.geometry.pointr   sympy.geometry.ellipser   r   sympy.geometry.liner   r   r   r   sympy.geometry.polygonr   r   r   r   sympy.integrals.integralsr   r   sympy.core.logicr   r   sympy.matricesr   r   r   sympy.ntheory.generater   r   sympy.physics.paulialgebrar   r   r   r  r  sympy.polys.domains.integerringr  !sympy.polys.domains.rationalfieldr  rC  r  r  r  r  r%  r+  r,  r0  r>  rD  rH  r]  ra  sympy.printing.latexrb  sympy.printing.mathmlrc  rd  sympy.printing.pretty.prettyre   sympy.printing.pretty.stringpictrf  rg  sympy.printing.printerrh  sympy.printing.pythonri  rj  rl  rn  ro  sympy.series.limitsrp  sympy.series.orderrq  rs  sympy.concrete.productsrt  sympy.concrete.summationsru  rv  r{  r}  r  r2   r2   r2   r9   <module>   s    0$9	
	





<
a


