<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def change_quantity(self, pk, quantity):
 """Change the quantity of an item. Parameters pk : str or int The primary key of the item. quantity : int-convertible A new quantity. Raises ------ ItemNotInCart NegativeItemQuantity NonConvertibleItemQuantity TooLargeItemQuantity ZeroItemQuantity """

        pk = str(pk)
        try:
            item = self.items[pk]
        except KeyError:
            raise ItemNotInCart(pk=pk)
        item.quantity = quantity
        self.update()