from IPython import get_ipython  # type: ignore


def _in_notebook() -> bool:  # pragma: no cover
    """
    Checks if running in a Jupyter Notebook.

    Returns
    -------
        in_notebook: bool
    """
    try:
        if 'IPKernelApp' in get_ipython().config:
            return True
    except Exception as e:
        pass
    return False