def _cookie_dict(cookie_list):
    """Convert list of cookies to dict of the form

    { 'path': {'key': {cookie} } }
    """
    cookie_dict = {}
    for cookie in cookie_list:
        path_cookies = cookie_dict.setdefault(cookie['path'], {})
        path_cookies[cookie['name']] = cookie
    return cookie_dict
Convert list of cookies to dict of the form

{ 'path': {'key': {cookie} } }
jupyterhub/tests/browser/test_browser.py