human
I wrote the below code

    jobs = SortedDict()
    def handle(bundle, work_list=[], parent_filters=[], output=False, debug=None):
        (do_merge, do_filters) = resolve_action(bundle, debug, allow_debug=allow_debug)
        sum_filters = parent_filters
        if (do_filters and bundle.filters):
            sum_filters = merge_filters(bundle.filters, parent_filters)
        create_needed = False
        if (not do_merge):
            output = False
        elif (not output):
            output = bundle.output
            create_needed = True
        else:
            pass
        _files = []
        for c in bundle.contents:
            if (not isinstance(c, Bundle)):
                if (not do_merge):
                    jobs[c] = c
                else:
                    _files.append(c)
            else:
                this_debug = (bundle.debug if (bundle.debug != None) else debug)
                if do_merge:
                    if _files:
                        work_list.append((sum_filters, _files))
                    _files = []
                    handle(c, work_list, sum_filters, output, this_debug)
                else:
                    handle(c, [], sum_filters, None, this_debug)
        if _files:
            work_list.append((sum_filters, _files))
        if create_needed:
            if output:
                if (output in jobs):
                    raise BundleError(('Bundle    %s    targets    the    same    output    file    as    another    bundle:    %s' % (bundle, output)))
                jobs[output] = work_list[:]
                del work_list[:]
            elif ((not output) and work_list):
                raise BundleError(('No    output    target    found    for    %s' % bundle))
    handle(bundle)
    return jobs

What's a good function header?

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

def bundle_to_joblist(bundle, allow_debug=True):