<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _build_receipt_table(result, billing="hourly", test=False):
 """Retrieve the total recurring fee of the items prices"""

    title = "OrderId: %s" % (result.get('orderId', 'No order placed'))
    table = formatting.Table(['Cost', 'Description'], title=title)
    table.align['Cost'] = 'r'
    table.align['Description'] = 'l'
    total = 0.000
    if test:
        prices = result['prices']
    else:
        prices = result['orderDetails']['prices']

    for item in prices:
        rate = 0.000
        if billing == "hourly":
            rate += float(item.get('hourlyRecurringFee', 0.000))
        else:
            rate += float(item.get('recurringFee', 0.000))
        total += rate
        table.add_row([rate, item['item']['description']])
    table.add_row(["%.3f" % total, "Total %s cost" % billing])
    return table