def _ipython_active():
    """return true if in an active IPython session"""
    try:
        import IPython
    except ImportError:
        return False

    try:
        if IPython.__version__ >= "0.12":
            return __IPYTHON__
        return __IPYTHON__active
    except __HOLE__:
        return False
dataset/ETHPy150Open manahl/mdf/mdf/viewer/__init__.py/_ipython_active