<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _detect_notebook():
 """ This isn't 100% correct but seems good enough Returns ------- bool True if it detects this is a notebook, otherwise False. """

    try:
        from IPython import get_ipython
        from ipykernel import zmqshell
    except ImportError:
        return False
    kernel = get_ipython()
    return isinstance(kernel, zmqshell.ZMQInteractiveShell)