human
I wrote the below code

    def NBSP():
        return XML('&nbsp;')
    rheader = problem_rheader(r)
    response.view = 'delphi/results.html'
    empty = dict(rheader=rheader, num_voted=0, chart='', table_color='', grids='', summary='')
    problem = r.record
    if problem:
        vtable = s3db.delphi_vote
        query = (vtable.problem_id == problem.id)
        votes = db(query).select(vtable.solution_id, vtable.rank, vtable.created_by)
    else:
        votes = None
    if (not votes):
        return empty
    stable = s3db.delphi_solution
    query = (stable.problem_id == problem.id)
    solutions = db(query).select(stable.id, stable.name, stable.problem_id, stable.changes)
    if (not solutions):
        return empty
    arrayF = {}
    arrayP = {}
    arrayX = {}
    arrayP2 = {}
    arrayU = {}
    for solution in solutions:
        s1 = solution.id
        for sol_2 in solutions:
            s2 = sol_2.id
            if (s1 == s2):
                arrayF[(s1, s2)] = None
                arrayP[(s1, s2)] = None
                arrayX[(s1, s2)] = None
                arrayP2[(s1, s2)] = None
                arrayU[(s1, s2)] = None
                continue
            arrayF[(s1, s2)] = 0
            arrayP[(s1, s2)] = 0.5
            arrayX[(s1, s2)] = 0
            arrayP2[(s1, s2)] = 0.5
            arrayU[(s1, s2)] = 0.5
    voters = []
    for vote in votes:
        voter = vote.created_by
        if (voter not in voters):
            voters.append(voter)
    num_voted = len(voters)
    for voter in voters:
        ranks = {}
        for vote in votes:
            if (vote.created_by != voter):
                continue
            ranks[vote.rank] = vote.solution_id
        for rank_1 in range(1, len(ranks)):
            for rank_2 in range((rank_1 + 1), (len(ranks) + 1)):
                arrayF[(ranks[rank_1], ranks[rank_2])] += 1
    grids = DIV()
    header = TR(TD())
    rows = TBODY()
    for solution in solutions:
        header.append(TH(solution.name))
        s1 = solution.id
        row =...

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

def results(r, **attr):