def get_stored_endpoints(db, ipython_display):
    """Gets a list of endpoints that were added in previous notebook sessions

    Args:
        db (dict): the ipython database where stored_endpoints list will be stored
        ipython_display (hdijupyterutils.ipythondisplay.IpythonDisplay): the display that
        informs the user of any errors that occur while restoring endpoints

    Returns:
        stored_endpoints (Sequence[dict]): A list of dicts, each dict storing an
        Endpoint's writeable attributes. If no endpoints can be obtained from previous
        notebook sessions, an empty list is returned.
    """
    try:
        stored_endpoints = db['autorestore/' + 'stored_endpoints']
        return stored_endpoints
    except KeyError:
        db['autorestore/' + 'stored_endpoints'] = list()
        return list()
    except Exception as caught_exc:
        db['autorestore/' + 'stored_endpoints'] = list()
        ipython_display.writeln("Failed to restore stored_endpoints from a previous notebook "\
                        f"session due to an error: {str(caught_exc)}. Cleared stored_endpoints.")
        return list()