def remove(self, order):
    price = Decimal(order['price'])
    if (order['side'] == 'buy'):
        bids = self.get_bids(price)
        if (bids is not None):
            bids = [o for o in bids if (o['id'] != order['order_id'])]
            if (len(bids) > 0):
                self.set_bids(price, bids)
            else:
                self.remove_bids(price)
    else:
        asks = self.get_asks(price)
        if (asks is not None):
            asks = [o for o in asks if (o['id'] != order['order_id'])]
            if (len(asks) > 0):
                self.set_asks(price, asks)
            else:
                self.remove_asks(price)
def remove(self, order):
    price = Decimal(order['price'])
    if (order['side'] == 'buy'):
        bids = self.get_bids(price)
        if (bids is not None):
            bids = [o for o in bids if (o['id'] != order['order_id'])]
            if (len(bids) > 0):
                self.set_bids(price, bids)
            else:
                self.remove_bids(price)
    else:
        asks = self.get_asks(price)
        if (asks is not None):
            asks = [o for o in asks if (o['id'] != order['order_id'])]
            if (len(asks) > 0):
                self.set_asks(price, asks)
            else:
                self.remove_asks(price)