human
I wrote the below code

    doc_path = root[3:]
    if (not os.path.isdir(doc_path)):
        os.mkdir(doc_path)
    f = rst_for_module(doc_path)
    w(f, u'..    toctree::')
    def toc(doc_path, name):
        parent = os.path.dirname(doc_path)
        toc_path = os.path.join(doc_path[len(parent):].lstrip(u'/'), name)
        if toc_path.endswith(u'.py'):
            toc_path = toc_path[:(- len(u'.py'))]
        w(f, u'                {}', toc_path)
        return os.path.join(parent, toc_path)
    for name in sorted((dirs + files)):
        if (name in dirs):
            toc(doc_path, name)
        else:
            if (not name.endswith(u'.py')):
                continue
            if (name == u'__init__.py'):
                continue
            toc_path = toc(doc_path, name)
            rst_for_module(toc_path)

What's a good function header?

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

def rst_for_package(root, dirs, files):