human
Complete this python program:
def in_interactive_session():
assistant
#Here is the Python code you requested.

    """check if we\re running in an interactive shell
    returns True if running under python/ipython interactive shell
    """
    def check_main():
        import __main__ as main
        return ((not hasattr(main, '__file__')) or get_option('mode.sim_interactive'))
    try:
        return (__IPYTHON__ or check_main())
    except:
        return check_main()