<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def urls(order_by: Optional[str] = None):
 """List all URLs registered with the app."""

    url_rules: List[Rule] = current_app.url_map._rules

    # sort the rules. by default they're sorted by priority,
    # ie in the order they were registered with the app
    if order_by == 'view':
        url_rules = sorted(url_rules, key=lambda rule: _get_rule_view(rule))
    elif order_by != 'priority':
        url_rules = sorted(url_rules, key=lambda rule: getattr(rule, order_by))

    headings = ('Method(s)', 'Rule', 'Endpoint', 'View', 'Options')
    print_table(headings,
                [(_get_http_methods(url_rule),
                  url_rule.rule if url_rule.strict_slashes
                                else url_rule.rule.rstrip('/') + '[/]',
                  url_rule.endpoint,
                  _get_rule_view(url_rule),
                  _format_rule_options(url_rule),
                  ) for url_rule in url_rules],
                ['<' if i > 0 else '>' for i, col in enumerate(headings)],
                primary_column_idx=1)