def parse_bids_asks(self, bidasks, price_key=0, amount_key=1):
    result = []
    if len(bidasks):
        if (type(bidasks[0]) is list):
            for bidask in bidasks:
                if (bidask[price_key] and bidask[amount_key]):
                    result.append(self.parse_bid_ask(bidask, price_key, amount_key))
        elif (type(bidasks[0]) is dict):
            for bidask in bidasks:
                if ((price_key in bidask) and (amount_key in bidask) and (bidask[price_key] and bidask[amount_key])):
                    result.append(self.parse_bid_ask(bidask, price_key, amount_key))
        else:
            self.raise_error(ExchangeError, details=('unrecognized bidask format: ' + str(bidasks[0])))
    return result
def parse_bids_asks(self, bidasks, price_key=0, amount_key=1):
    result = []
    if len(bidasks):
        if (type(bidasks[0]) is list):
            for bidask in bidasks:
                if (bidask[price_key] and bidask[amount_key]):
                    result.append(self.parse_bid_ask(bidask, price_key, amount_key))
        elif (type(bidasks[0]) is dict):
            for bidask in bidasks:
                if ((price_key in bidask) and (amount_key in bidask) and (bidask[price_key] and bidask[amount_key])):
                    result.append(self.parse_bid_ask(bidask, price_key, amount_key))
        else:
            self.raise_error(ExchangeError, details=('unrecognized bidask format: ' + str(bidasks[0])))
    return result