def consume_items(self, consume_transaction):
        item_key = consume_transaction.key
        try:
            user_item_amount = self.user_items[item_key]['amount']
            if user_item_amount < consume_transaction.consume_amount:
                # current values must match in order to apply the transaction
                return False
        except KeyError:
            return False

        new = user_item_amount - consume_transaction.consume_amount
        if new == 0:
            del self.user_items[item_key]
        else:
            self.user_items[item_key]['amount'] = new

        self._write()
        return True
dataset/ETHPy150Open turbulenz/turbulenz_local/turbulenz_local/models/apiv1/store.py/StoreUserGameItems.consume_items/original