human
I wrote the below code

    if (not test_user_authenticated(request)):
        return login(request, next='/cobbler_web/events', expired=True)
    events = remote.get_events()
    events2 = []
    for id in events.keys():
        (ttime, name, state, read_by) = events[id]
        events2.append([id, time.asctime(time.localtime(ttime)), name, state])
    def sorter(a, b):
        return cmp(a[0], b[0])
    events2.sort(sorter)
    t = get_template('events.tmpl')
    html = t.render(RequestContext(request, {'results': events2, 'version': remote.extended_version(request.session['token'])['version'], 'username': username}))
    return HttpResponse(html)

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

def events(request):