def is_ipython_notebook() -> bool:
    """Helper function to detect whether we are running in a notebook environment.

    Returns
    -------
    bool
        True if we are running in a notebook ipython environment.
    """
    # TODO: FIXME: Remove if unused.
    try:
        shell = get_ipython().__class__.__name__
        if shell == 'ZMQInteractiveShell':
            return True  # Jupyter notebook or qtconsole
        elif shell == 'TerminalInteractiveShell':
            return False  # Terminal running IPython
        else:
            return False  # Other type (?)
    except NameError:
        return False  # Probably standard Python interpreter
