()
return False
Returns True if execution context is inside a kernel
Returns True if execution context is inside a kernel
Returns True if execution context is inside a kernel
def is_kernel():
    """
    Returns True if execution context is inside a kernel
    """
    # if IPython hasn't been imported, there's nothing to check
    if 'IPython' in sys.modules:
        from IPython import get_ipython

        ipy = get_ipython()
        if ipy is not None:
            return getattr(ipy, 'kernel', None) is not None
    return False
def is_kernel ( ) : # if IPython hasn't been imported, there's nothing to check if 'IPython' in sys . modules : from IPython import get_ipython ipy = get_ipython ( ) if ipy is not None : return getattr ( ipy , 'kernel' , None ) is not None return False