def _get_cookies(request):
    cookies = Cookie.SimpleCookie()
    if request.cookies:
        for key in request.cookies:
            cookies.load(request.cookies[key].output(None, ''))
    if request.cookies is not request.session.cookies:
        _load_cookies(cookies, request.session)
    elif request.session.parent:
        _load_cookies(cookies, request.session.parent)
    return cookies
Build a SimpleCookie with all the necessary cookies.
dataset/ETHPy150Open ecdavis/pants/pants/http/client.py/_get_cookies