def _ipython_active():
    try:
        import IPython
    except ImportError:
        return False

    try:
        if IPython.__version__ >= "0.12":
            return __IPYTHON__
        return __IPYTHON__active
    except NameError:
        return False
return true if in an active IPython session
dataset/ETHPy150Open manahl/mdf/mdf/viewer/__init__.py/_ipython_active