'Retrieve all of the current open orders.
Parameters
asset : Asset
If passed and not None, return only the open orders for the given
asset instead of all open orders.
Returns
open_orders : dict[list[Order]] or list[Order]
If no asset is passed this will return a dict mapping Assets
to a list containing all the open orders for the asset.
If an asset is passed then this will return a list of the open
orders for this asset.'

@error_keywords(sid='Keyword    argument    `sid`    is    no    longer    supported    for    get_open_orders.    Use    `asset`    instead.')
@api_method
def get_open_orders(self, asset=None):

    if (asset is None):
        return {key: [order.to_api_obj() for order in orders] for (key, orders) in iteritems(self.blotter.open_orders) if orders}
    if (asset in self.blotter.open_orders):
        orders = self.blotter.open_orders[asset]
        return [order.to_api_obj() for order in orders]
    return []
