+
    h'                        R t ^ RIt^ RIHtHt ^ RIHt ^ RIHtH	t	H
t
HtHt ^ RIHt ^ RIHtHt ^ RIHtHtHt ^ RIHt ^ R	IHtHtHt ^ R
IHt ^ RIHtH t  ^ RI!H"t" ^ RI#H$t$ ^ RI%H&t& ^ RI'H(t(H)t) ^ RI*H+t+H,t, ^ RI-H.t. ^ RI/H0t0 ]! 4       t1]! ]14      t2]! ]24      t3]! ]2]14      t4]! R4      t5R t6R t7R t8R t9R t:R t;R t<R t=R t>R t?R t@R tAR  tBR! tCR" tDR# tER$ tFR% tGR& tHR' tIR( tJR) tKR* tLR+ tMR, tNR# )-zZThis tests sympy/core/basic.py with (ideally) no reference to subclasses
of Basic or Atom.N)TypeVarGeneric)Q)BasicAtomas_Basic_atomic_aresame)Tuple)FunctionLambda)IpiFloat)S)symbolsSymbolDummy)Sum)cossin)gamma)Integral)exp)raiseswarns_deprecated_sympy)Abssign)	Piecewise)EqTc                  R   \        \        \        4       4      \        4       4      '       d   Q h\        ^4      \        R4      3R\	        ^4      33 FR  w  r\        ^4       F>  p\        \        V 4      \        V4      4      '       d   Q h\        W4      '       d   Q hYrK@  	  KT  	  R# )   g       @g      ?N)r	   r   r
   r   r   range)ijdos      =/usr/lib/python3/dist-packages/sympy/core/tests/test_basic.pytest__aresamer(      s    eg0000A$"U1X/(Ba%(3333~~%%q  0    c                      \         P                  \        \        38X  g   Q h\         P                  ! \         P                  !  \         8X  g   Q h\        \        4      '       g   Q hR # N)b21argsb2b1funcbool r)   r'   test_structurer3   (   s@    88Bx88SXX#%%%88O8r)   c                      \        \        R 4      '       d   Q h\        \        4      ;_uu_ 4        ^\        n        RRR4       R#   + '       g   i     R# ; i)__dict__N)hasattrr/   r   AttributeErrorxr2   r)   r'   test_immutabler9   .   s6    r:&&&&			 
 			s   AA	c            	      P   \         \        \        \        \	        \         \         \         4      \        .p \        V 4       F3  w  r\        V 4       F  w  r4W$8H  W8H  8X  g   Q hW$8g  W8g  8X  d   K  Q h	  K5  	  \	        4       . 8w  g   Q h\	        4       . 8X  d   Q h\	        4       ^ 8w  g   Q h\	        4       ^ 8X  d   Q h ! R R4      p\	        4       pV! 4       pWg8w  g   Q hWv8w  g   Q hWg8X  d   Q hWv8X  d   Q h ! R R4      pV! 4       p	Wi8X  g   Q hW8X  g   Q hWi8w  d   Q hW8w  d   Q hR# )    c                       ] tR t^@tRtRtR# )test_equality.<locals>.Fooz
Class that is unaware of Basic, and relies on both classes returning
the NotImplemented singleton for equivalence to evaluate to False.

r2   N)__name__
__module____qualname____firstlineno____doc____static_attributes__r2   r)   r'   Foor=   @   s    	r)   rD   c                   0   a  ] tR t^Ot o RtR tR tRtV tR# )test_equality.<locals>.Barz
Class that considers itself equal to any instance of Basic, and relies
on Basic returning the NotImplemented singleton in order to achieve
a symmetric equivalence relation.

c                >    \        V\        4      '       d   R # \        # )T)
isinstancer   NotImplementedselfothers   &&r'   __eq__!test_equality.<locals>.Bar.__eq__V   s    %''!!r)   c                    W8X  * # r+   r2   rJ   s   &&r'   __ne__!test_equality.<locals>.Bar.__ne__[   s    $$r)   r2   N)	r>   r?   r@   rA   rB   rM   rP   rC   __classdictcell__)__classdict__s   @r'   BarrF   O   s     		"
	% 	%r)   rT   N)r/   r.   b3r,   r   	enumerate)
	instancesr$   b_ir%   b_jrD   bfoorT   bars
             r'   test_equalityr]   4   s   RS%B"3U;II&	*FAJAF+++JAF+++ + '
 7b==w"}7a<<w!|  	A
%C8O88O8x<x<% % %C8O88O8x<x<xr)   c                     \        \        \        \        4      \        \        \        \        4      \        \        \        \        4      \        \        \        4      \        \        \        4      \        \        .p \        V 4       FN  w  r\        V 4       F:  w  r4W8X  d   VP	                  V4      / 8X  g   Q hK%  VP	                  V4      f   K:  Q h	  KP  	  \        P                  \        4      / 8X  g   Q hR # r+   )r   r/   r.   rV   matchesmatch)rW   r$   rX   r%   rY   s        r'   test_matches_basicra   f   s    r2r"E"b"$5uRR7Hr2b"r27II&	*FAv{{3'2---{{3'///	 + ' 88B<2r)   c                     \         P                  \        4      '       g   Q h\         P                  \        \        4      '       g   Q h\         P                  \        4      '       g   Q h\        P                  \         \        4      '       d   Q h\         P                  4       '       d   Q h\         P                  \
        4      '       d   Q h\        R 4      P                  R 4      '       d   Q hR# )r8   N)r,   hasr/   rU   r   strr   r2   r)   r'   test_hasre   r   s    772;;;772r???775>>>vvc2wwyy=wws||c{s#####r)   c                     \         P                  \        \        4      \	        \        \        4      8X  g   Q h\         P                  \        \         4      \	        \         \        4      8X  g   Q h\
        P                  \        \        4      \        8X  g   Q h\         P                  \        \        3\        \        3.4      \	        \        \        4      8X  g   Q h\         P                  \        \        \        \        /4      \	        \        \        4      8X  g   Q h\         P                  \        P                  ! \        \        /\        \        /4      4      \	        \        \        4      8X  g   Q h\         P                  \        P                  ! \        \        3\        \        3.4      4      \	        \        \        4      8X  g   Q h\        \        R  4       \        \        R 4       \        \        R 4       \        R4      P                  R\        /4      \        8X  g   Q h\        R4      P                  R^/4      ^8X  g   Q hR# )c                  ,    \         P                  R 4      # )bad argr,   subsr2   r)   r'   <lambda>test_subs.<locals>.<lambda>   s    sxx	2r)   c                  H    \         P                  \        \        \        4      # r+   )r,   rj   r/   r.   rU   r2   r)   r'   rk   rl      s    chhr2r2r)   c                  .    \         P                  R R7      # )rh   )r/   ri   r2   r)   r'   rk   rl      s    chh)h4r)   textsN)r,   rj   r.   r/   r   rU   collectionsChainMapOrderedDictr   
ValueError	TypeErrorr   r2   r)   r'   	test_subsrv   |   su   88BuR},,,88Bc2...772r?b   88b"XBx()U2r]:::88RR$%r266688K(("bB8<=r2NNN88K++b"XBx,@ABeBPRmSSS
:23
923 945&>|,222#;S!H%***r)   c                      \        R 4      p V P                  R R4      pVP                  R8X  g   Q hV P                  R R4      pVP                  R8X  g   Q hR# )var1r8   N)r   rj   name)exprreplaceds     r'   test_subs_with_unicode_symbolsr|      sO    &>Dyy%H==Cyy%H==Cr)   c                  N    \         P                  4       \        4       08X  g   Q hR # r+   )r,   atomsr   r2   r)   r'   
test_atomsr      s    99;57)###r)   c                  D    \         P                  \        4       8X  g   Q hR # r+   )r,   free_symbolssetr2   r)   r'   test_free_symbols_emptyr      s    su$$$r)   c                      \         P                  4       \         8X  g   Q h\         P                  R R7      \         8X  g   Q hR# )F)deepN)r,   doitr2   r)   r'   	test_doitr      s/    88:8883&&&r)   c                  2    \        \        4      R 8X  g   Q hR# )r   N)reprr   r2   r)   r'   test_Sr      s    7c>>r)   c                  .   \         P                  \        \        /4      \	        \        \        4      8X  g   Q h\         P                  \        \         /4      \	        \         \        4      8X  g   Q h\
        P                  \        \        /4      \        8X  g   Q h\	        \        \        4      P                  \        \        \        \        /4      \	        \        \        4      8X  g   Q h\        \        4      P                  \        \        /4      \        \        4      8X  g   Q h\        \        4      P                  \        \        4      \        /4      \        8X  g   Q h\        \        R  4       \        \        R 4       \        \        R4      3 F{  p V P                  / 4      V 8X  g   Q hV P                  / RR7      V 8X  g   Q hV P                  V \        /4      \        8X  g   Q hV P                  V \        /RR7      \        8X  d   K{  Q h	  R# )c                  *    \         P                  4       # r+   )r/   xreplacer2   r)   r'   rk   test_xreplace.<locals>.<lambda>   s
    bkkmr)   c                  @    \         P                  \         \        .4      # r+   )r/   r   r.   r2   r)   r'   rk   r      s    bkk2r(3r)   fT)hack2N)r,   r   r.   r/   r   rU   r   r   ru   r   r   )r   s    r'   test_xreplacer      sk   <<R!U2r]222<<S	"eCn444;;Bx B&&&R=!!2r2r"23uR}DDD8b"X&$r(2228d2h^,222
9+,
9348C=!zz"~"""zz"Dz)Q...zz1b'"b(((zz1b'z."444	 "r)   c                     a  \        R 4      o \        P                  \        P                  8X  g   Q h\	        \
        V 3R l4       R# )r8   c                     < S P                   # r+   )_sorted_argsr8   s   r'   rk   "test_sorted_args.<locals>.<lambda>   s	    1>>r)   N)r   r,   r   r-   r   r7   r   s   @r'   test_sorted_argsr      s/    Asxx'''
>12r)   c                    a \        R 4      w  op \        \        V3R l4       \        \        V3R l4       \        S4      P	                  ^4      \        S4      8X  g   Q h^\        S4      ,           P	                  ^4      ^\        S4      ,           8X  g   Q h\        S^S,          4      pVS,           P	                  V 4      ^V ,          S,           8X  g   Q hSV,          P	                  ^4      S^,          8X  g   Q h\        P                  \        P                  ,          P	                  S4      \        P                  ! S4      \        P                  ! S4      ,          8X  g   Q hR# )x yc                  @   < \        S 4      ! S ^\        S 4      ^/4      #    r   r   s   r'   rk   test_call.<locals>.<lambda>   s    c!fq1c!fq%9:r)   c                  &   < \        S 4      ! ^4      # r   r   r   s   r'   rk   r      s    c!fQir)   N)	r   r   ru   r   rcallr   r   realpositive)ylr8   s     @r'   	test_callr      s    5>DAq 9:;
9'( q6<<?c!f$$$AJa AAJ... 	q!A#AE==qsQw&&&qD<<?ad"""
 FFQZZ&&q)QVVAYA-FFFFr)   c                  z   \        R 4      w  rp\        R4      w  r4\        V 4      \        V 4      ,           pVP                  \        \        4      \	        \
        V ,          4      ^,          \        V 4      ,           \	        \
        ) V ,          4      ^,          ,           8X  g   Q hVP                  \        .\        4      \        V 4      \        V \        ^,          ,           RR7      ,           8X  g   Q h\        V 4      \        V4      \        V4      ,          ,           pVP                  \        \        4      \
        ) \	        \
        V ,          4      \	        \
        ) V ,          4      ,
          ,          ^,          \        V4      \        V4      ,          ,           8X  g   Q hVP                  4       V8X  g   Q hR# )zx y zza bF)evaluateN)r   r   r   rewriter   r   r   r   )r8   r   zarZ   f1f2s          r'   test_rewriter      s   gGA!5>DA	Q#a&B::c##ac(1*s1v"5QBqD	!"CCCC::seC CFSRTE-J$JJJJ	Q#a&q/	!B::c#1"c!A#haRT&:";A"=AuQx"OOOO::<2r)   c                  z   \        R 4      p \        R4      pVP                  RJ g   Q hV! ^4      P                  RJ g   Q h\        ^ W V 34      pVP	                  4       ^ 8X  g   Q hVP
                  '       g   Q hVP                  RJ g   Q hVP                  ^RR7      ^ 8X  g   Q h\        ^4      ^,          \        ^4      ^,          ,           ^,
          pVP                  RJ g   Q hVP	                  ^4      P                  RJ g   Q hVP	                  ^4      P	                  ^4      P                  '       g   Q hR# )r8   r   F)strictN)
r   r   	is_numberr   nis_zeroevalfr   r   is_comparable)r8   r   r$   r   s       r'   2test_literal_evalf_is_number_is_zero_is_comparabler      s   AA ;;%Q4>>U"""Q1IA 335A::9999;;%771U7#q((( 	A	CFAI!A??e###33q65(((33q688A;$$$$$r)   c                      \        ^4      \        P                  J g   Q h\        R4      \        4       8X  g   Q h\	        \
        R 4       R# )r   c                      \        . 4      # r+   )r   r2   r)   r'   rk   test_as_Basic.<locals>.<lambda>   s    hrlr)   Nr2   )r   r   Oner
   r   ru   r2   r)   r'   test_as_Basicr      s7    A;!%%B<57"""
9*+r)   c            	         \        \        R 4      w  r\        R4      p\        V ! W!! V4      ,           4      4      V ! W!! V4      ,           4      08X  g   Q h\        V ! W!! V4      ,           4      RR7      V! V4      W ! W!! V4      ,           4      08X  g   Q h\        ^4      \	        4       8X  g   Q h\        \        \        ^4      \        ^4      4      4      \	        4       8X  g   Q hR# )ghr8   T)	recursiveN)mapr   r   r   r   r   r   )ghr8   s      r'   test_atomicr     s    xDAA1Q1X;Aa!A$hK=0001Q1X;$/AaD!Qq1Q4x[3IIII1:51qt$%...r)   c                     \        R 4      w  rr#rEp\        W"^,           4      P                  4       \        WU^,           4      8X  g   Q h\        W"V,           4      P                  4       \        WeV,           4      8X  g   Q h^\        W"^V34      ,           p^\        WU^V34      ,           pVP                  4       p	W8X  g   Q hV	P                  4       p
W8X  g   Q h\	        W%,           W"^,           3V^^34      P                  4       \	        WV,           WR^,           3V^^34      8X  g   Q h\
        \        3 FH  pV! RRR7      pVP                  4       pW8w  d&   VP                  \        8X  d   VP                  f   KH  Q h	  \        4       P                  4       P                  '       g   Q h\        RR7      P                  4       P                  RJ g   Q hR# )zu v x y z _0 _1r8   T)r   NF)commutative)
r   r   as_dummyr   r   r   r   r0   is_realis_commutative)uvr8   r   r   _0_1eqansoncetwicer    dDs                 r'   test_as_dummyr     s   #$56A!r!U$$&&!V*<<<<!V%%'6"2g+>>>>
c!AY
B
c"1aj!
!C;;=D;;MMOE<<AFQAJQ
 

(*21u+AqzBC C Ce_cJJLv!&&E/aii.???  7,,,,,U#,,.==FFFr)   c                     \        R 4      w  rp\        W V ^,           34      P                  W/8X  g   Q h\        W V ^,           3V^^34      P                  WW/8X  g   Q h\        W W,           34      P                  W/8X  g   Q hR# )zx _:2N)r   r   canonical_variables)r8   i0i1s      r'   test_canonical_variablesr     s     IA2A1q5z"661'AAAA1q5zB1:.BB	rG   A16{#77A7BBBr)   c                  $  aaa ^ RI Hp  \        R4      w  rV^,          W,          ,           o\        \        V3R l4       V ! R4      oV ! R4      o\        \        VVV3R l4       \        \        VV3R l4       \        \        V3R l4       R	# )
r;   )Wildr   c                  0   < S P                  \        ^4      # )r"   )replacer   es   r'   rk   )test_replace_exceptions.<locals>.<lambda>+  s    aiiQ/r)   rZ   cc                  J   < SP                  S S,          SP                  4      # r+   r   r   )rZ   r   r   s   r'   rk   r   .  s    aii!QYY7r)   c                  <   < SP                  S P                  ^4      # r   r   )rZ   r   s   r'   rk   r   /  s    aii		15r)   c                  *   < S P                  R  ^4      # )c                     V P                   # r+   )	is_Number)r   s   &r'   rk   ;test_replace_exceptions.<locals>.<lambda>.<locals>.<lambda>0  s    !++r)   )r   r   s   r'   rk   r   0  s    aii(=qAr)   N)sympy.core.symbolr   r   r   ru   )r   r8   r   rZ   r   r   s      @@@r'   test_replace_exceptionsr   '  s^    &5>DA	
AA
9/0S	AS	A
978
956
9ABr)   c                     a ^ RI Hp  . o ! V3R lRV 4      pRp\        4       ;_uu_ 4        \        V4       RRR4       SR.8X  g   Q hR#   + '       g   i     L; i)r;   )ManagedPropertiesc                   6   <a a ] tR tRt oV V3R ltRtVtV ;t# )&test_ManagedProperties.<locals>.MyMetai;  c                J   < SP                  R 4       \        SV `  ! V/ VB  R# )executedN)appendsuper__init__)clsr-   kwargs	__class__	myclassess   &*,r'   r   /test_ManagedProperties.<locals>.MyMeta.__init__<  s#    Z(Gd-f-r)   r2   )r>   r?   r@   rA   r   rC   rR   __classcell__)r   rS   r   s   @@r'   MyMetar   ;  s     	. 	.r)   r   z5
class MySubclass(Basic, metaclass=MyMeta):
    pass
Nr   )sympy.core.assumptionsr   r   exec)r   r   coder   s      @r'   test_ManagedPropertiesr   3  sS     9I." .
D 
 	!	!T
 
" $$$ 
"	!s   AA	c                  p     ! R  R\         \        \        ,          4      p  ! R RV \        ,          4      pR# )c                       ] tR tRtRtR# )test_generic.<locals>.AiL  r2   Nr>   r?   r@   rA   rC   r2   r)   r'   Ar   L      r)   r  c                       ] tR tRtRtR# )test_generic.<locals>.BiO  r2   Nr   r2   r)   r'   Br  O  r  r)   r  N)r   r   r    )r  r  s     r'   test_genericr  J  s$    FGAJ AaD r)   c                  8   \        R 4      p \        V 4      P                  \        4      \        V 4      P                  \        4      8X  g   Q h\        V 4      P                  \        4      \        ^ \        V ^ 4      3V \	        V 4      ,          R34      8X  g   Q hR# )r8   TN)r   r   r   absr   r   r   r   s    r'   test_rewrite_absr	  S  sl    sA7??347??3#77777??39aAq]QQZ<N#OOOOr)   )OrB   rq   typingr   r   sympy.assumptions.askr   sympy.core.basicr   r   r   r   r	   sympy.core.containersr
   sympy.core.functionr   r   sympy.core.numbersr   r   r   sympy.core.singletonr   r   r   r   r   sympy.concrete.summationsr   (sympy.functions.elementary.trigonometricr   r   'sympy.functions.special.gamma_functionsr   sympy.integrals.integralsr   &sympy.functions.elementary.exponentialr   sympy.testing.pytestr   r   $sympy.functions.elementary.complexesr   r   $sympy.functions.elementary.piecewiser   sympy.core.relationalr   r/   r.   rU   r,   r    r(   r3   r9   r]   ra   re   rv   r|   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r	  r2   r)   r'   <module>r     s     # #  ' 0 + + " 4 4 ) ? 9 . 6 ? : : $
W
2Y
2YBmCL/d	$+, $%'
5 3
G,	%4,/G(C	C%.Pr)   