<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def item_count(self, request, variant_id=None):

 """
 Get quantity of a single item in the basket
 """

        bid = utils.basket_id(request)
        item = ProductVariant.objects.get(id=variant_id)
        try:
            count = BasketItem.objects.get(basket_id=bid, variant=item).quantity
        except BasketItem.DoesNotExist:
            count = 0
        return Response(data={"quantity": count}, status=status.HTTP_200_OK)