human
I wrote the below code

    dateformat = '%Y-%m-%d'
    rows = ['Tenant    ID', 'Servers', 'RAM    MB-Hours', 'CPU    Hours', 'Disk    GB-Hours']
    now = timeutils.utcnow()
    if args.start:
        start = datetime.datetime.strptime(args.start, dateformat)
    else:
        start = (now - datetime.timedelta(weeks=4))
    if args.end:
        end = datetime.datetime.strptime(args.end, dateformat)
    else:
        end = (now + datetime.timedelta(days=1))
    def simplify_usage(u):
        simplerows = [x.lower().replace('    ', '_') for x in rows]
        setattr(u, simplerows[0], u.tenant_id)
        setattr(u, simplerows[1], ('%d' % len(u.server_usages)))
        setattr(u, simplerows[2], ('%.2f' % u.total_memory_mb_usage))
        setattr(u, simplerows[3], ('%.2f' % u.total_vcpus_usage))
        setattr(u, simplerows[4], ('%.2f' % u.total_local_gb_usage))
    if (cs.api_version < api_versions.APIVersion('2.40')):
        usage_list = cs.usage.list(start, end, detailed=True)
    else:
        usages = collections.OrderedDict()
        usage_list = cs.usage.list(start, end, detailed=True)
        _merge_usage_list(usages, usage_list)
        marker = _get_usage_list_marker(usage_list)
        while marker:
            next_usage_list = cs.usage.list(start, end, detailed=True, marker=marker)
            marker = _get_usage_list_marker(next_usage_list)
            if marker:
                _merge_usage_list(usages, next_usage_list)
        usage_list = list(usages.values())
    print((_('Usage    from    %(start)s    to    %(end)s:') % {'start': start.strftime(dateformat), 'end': end.strftime(dateformat)}))
    for usage in usage_list:
        simplify_usage(usage)
    utils.print_list(usage_list, rows)

What's a good function header?

Here's a good function header?
assistant
#Here's a good function header.

@utils.arg('--start', metavar='<start>', help=_('Usage    range    start    date    ex    2012-01-20.    (default:    4    weeks    ago)'), default=None)
@utils.arg('--end', metavar='<end>', help=_('Usage    range    end    date,    ex    2012-01-20.    (default:    tomorrow)'), default=None)
def do_usage_list(cs, args):