def ipython_shell_namespace():
    """
    get the IPython shell's namespace dictionary (or empty if not found)
    """
    try:
        from IPython import get_ipython
        ns = get_ipython().user_ns
    except AttributeError as _exc:
        ns = {}
    return ns
