<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def buy(ctx, buy_amount, buy_asset, price, sell_asset, order_expiration, account):
 """ Buy a specific asset at a certain rate against a base asset """

    amount = Amount(buy_amount, buy_asset)
    price = Price(
        price, base=sell_asset, quote=buy_asset, bitshares_instance=ctx.bitshares
    )
    print_tx(
        price.market.buy(price, amount, account=account, expiration=order_expiration)
    )