<s> from sympy import sin , cos , exp , cot , I , symbols <EOL> x , y , z , n = symbols ( '<STR_LIT>' ) <EOL> def test_has ( ) : <EOL> assert cot ( x ) . has ( x ) <EOL> assert cot ( x ) . has ( cot ) <EOL> assert not cot ( x ) . has ( sin ) <EOL> assert sin ( x ) . has ( x ) <EOL> assert sin ( x ) . has ( sin ) <EOL> assert not sin ( x ) . has ( cot ) <EOL> def test_sin_exp_rewrite ( ) : <EOL> assert sin ( x ) . rewrite ( sin , exp ) == - I / <NUM_LIT:2> * ( exp ( I * x ) - exp ( - I * x ) ) <EOL> assert sin ( x ) . rewrite ( sin , exp ) . rewrite ( exp , sin ) == sin ( x ) <EOL> assert cos ( x ) . rewrite ( cos , exp ) . rewrite ( exp , cos ) == cos ( x ) <EOL> assert ( sin ( <NUM_LIT:5> * y ) - sin ( <EOL> <NUM_LIT:2> * x ) ) . rewrite ( sin , exp ) . rewrite ( exp , sin ) == sin ( <NUM_LIT:5> * y ) - sin ( <NUM_LIT:2> * x ) <EOL> assert sin ( x + y ) . rewrite ( sin , exp ) . rewrite ( exp , sin ) == sin ( x + y ) <EOL> assert cos ( x + y ) . rewrite ( cos , exp ) . rewrite ( exp , cos ) == cos ( x + y ) <EOL> assert cos ( x ) . rewrite ( cos , exp ) . rewrite ( exp , sin ) == cos ( x ) </s>
