def METHOD_NAME(notebook: bool = False) -> bool:
    """
    Return True if running in IPython environment.
    Parameters
    ----------
    notebook : bool, optional
        If notebook is true this will only return true if running
        in a Jupyter notebook.
    Returns
    -------
    bool
        True if running in IPython environment,
        otherwise False
    """
    return (
        get_ipython() and type(get_ipython()).__name__.startswith("ZMQ")
        if notebook
        else bool(get_ipython())
    )