<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_rule_table(rules):
 """Formats output from get_all_rules and returns a table. """

    table = formatting.Table(['Id', 'KeyName'], "Rules")
    for rule in rules:
        table.add_row([rule['id'], rule['keyName']])
    return table