def in_interactive_session():
from pandas import get_option<EOL>def check_main():<EOL><INDENT>try:<EOL><INDENT>import __main__ as main<EOL><DEDENT>except ModuleNotFoundError:<EOL><INDENT>return get_option('<STR_LIT>')<EOL><DEDENT>return (not hasattr(main, '<STR_LIT>') or<EOL>get_option('<STR_LIT>'))<EOL><DEDENT>try:<EOL><INDENT>return __IPYTHON__ or check_main()  <EOL><DEDENT>except NameError:<EOL><INDENT>return check_main()<EOL><DEDENT>
check if we're running in an interactive shell

    returns True if running under python/ipython interactive shell