def _is_interactive():
        """ Decide whether this is running in a REPL or IPython notebook """
        main = __import__('__main__', None, None, fromlist=['__file__'])
        return not hasattr(main, '__file__')
 Decide whether this is running in a REPL or IPython notebook 
dynaconf/vendor/dotenv/main.py