human
Here's a good function header given the following:
I wrote the below code

    def make_stack(tb, stack=None):
        'Tracebacks    come    out    of    the    system    in    caller    ->    callee    order.        Return\n                                an    array    in    callee    ->    caller    order    so    we    can    traverse    it.'
        if (stack is None):
            stack = []
        if (tb is not None):
            make_stack(tb.tb_next, stack)
            stack.append(tb)
        return stack
    stack = make_stack(traceback)
    for tb in stack:
        frame = tb.tb_frame
        if ('self' in frame.f_locals):
            obj = frame.f_locals['self']
            if isinstance(obj, spack.package.PackageBase):
                break
    lines = []
    lines.append(('%s:%d,    in    %s:' % (inspect.getfile(frame.f_code), frame.f_lineno, frame.f_code.co_name)))
    (sourcelines, start) = inspect.getsourcelines(frame)
    for (i, line) in enumerate(sourcelines):
        mark = ('>>    ' if ((start + i) == frame.f_lineno) else '            ')
        lines.append(('        %s%-5d%s' % (mark, (start + i), line.rstrip())))
    return lines

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

def get_package_context(traceback):