def get_current_book(self):
    result = {'sequence': self._sequence, 'asks': [], 'bids': []}
    for ask in self._asks:
        try:
            this_ask = self._asks[ask]
        except KeyError:
            continue
        for order in this_ask:
            result['asks'].append([order['price'], order['size'], order['id']])
    for bid in self._bids:
        try:
            this_bid = self._bids[bid]
        except KeyError:
            continue
        for order in this_bid:
            result['bids'].append([order['price'], order['size'], order['id']])
    return result
def get_current_book(self):
    result = {'sequence': self._sequence, 'asks': [], 'bids': []}
    for ask in self._asks:
        try:
            this_ask = self._asks[ask]
        except KeyError:
            continue
        for order in this_ask:
            result['asks'].append([order['price'], order['size'], order['id']])
    for bid in self._bids:
        try:
            this_bid = self._bids[bid]
        except KeyError:
            continue
        for order in this_bid:
            result['bids'].append([order['price'], order['size'], order['id']])
    return result