<s> """<STR_LIT>""" <EOL> from sympy . interactive . session import ( init_ipython_session , <EOL> enable_automatic_symbols , enable_automatic_int_sympification ) <EOL> from sympy . core import Symbol , Rational , Integer <EOL> from sympy . external import import_module <EOL> ipython = import_module ( "<STR_LIT>" , min_module_version = "<STR_LIT>" ) <EOL> readline = import_module ( "<STR_LIT>" ) <EOL> if not ipython : <EOL> disabled = True <EOL> def test_automatic_symbols ( ) : <EOL> if not readline : <EOL> return None <EOL> app = init_ipython_session ( ) <EOL> app . run_cell ( "<STR_LIT>" ) <EOL> enable_automatic_symbols ( app ) <EOL> symbol = "<STR_LIT>" <EOL> assert symbol not in app . user_ns <EOL> app . run_cell ( "<STR_LIT>" % symbol , True ) <EOL> assert symbol not in app . user_ns <EOL> app . run_cell ( "<STR_LIT>" % symbol , True ) <EOL> assert app . user_ns [ '<STR_LIT:a>' ] == Symbol <EOL> app . run_cell ( "<STR_LIT>" % ( symbol , symbol ) , True ) <EOL> assert symbol in app . user_ns <EOL> app . run_cell ( "<STR_LIT>" , True ) <EOL> assert "<STR_LIT:all>" not in app . user_ns <EOL> assert app . user_ns [ '<STR_LIT:a>' ] is True <EOL> app . run_cell ( "<STR_LIT>" ) <EOL> app . run_cell ( "<STR_LIT>" , True ) <EOL> assert app . user_ns [ '<STR_LIT:a>' ] is True <EOL> def test_int_to_Integer ( ) : <EOL> app = init_ipython_session ( ) <EOL> app . run_cell ( "<STR_LIT>" ) <EOL> app . run_cell ( "<STR_LIT>" ) <EOL> assert isinstance ( app . user_ns [ '<STR_LIT:a>' ] , int ) <EOL> enable_automatic_int_sympification ( app ) <EOL> app . run_cell ( "<STR_LIT>" ) <EOL> assert isinstance ( app . user_ns [ '<STR_LIT:a>' ] , Rational ) <EOL> app . run_cell ( "<STR_LIT>" ) <EOL> assert isinstance ( app . user_ns [ '<STR_LIT:a>' ] , Integer ) <EOL> app . run_cell ( "<STR_LIT>" ) <EOL> assert isinstance ( app . user_ns [ '<STR_LIT:a>' ] , int ) <EOL> app . run_cell ( "<STR_LIT>" ) <EOL> assert app . user_ns [ '<STR_LIT:a>' ] == Rational ( <NUM_LIT:1> , <NUM_LIT:2> ) </s>
