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 NameError:
        return False
dataset/ETHPy150Open manahl/mdf/mdf/viewer/frame.py/_ipython_active/original