def get_cookie_basket(self, cookie_key, request, manager):
        basket = None
        if cookie_key in request.COOKIES:
            basket_hash = request.COOKIES[cookie_key]
            try:
                basket_id = Signer().unsign(basket_hash)
                basket = Basket.objects.get(pk=basket_id, owner=None,
                                            status=Basket.OPEN)
            except (BadSignature, Basket.DoesNotExist):
                request.cookies_to_delete.append(cookie_key)
        return basket
Looks for a basket which is referenced by a cookie.
dataset/ETHPy150Open django-oscar/django-oscar/src/oscar/apps/basket/middleware.py/BasketMiddleware.get_cookie_basket