human
Complete the below
@formatter
def rst(pkgs):

    ''''Print out information on all packages in restructured text.'
    '''
assistant
#Here is Python code to print out information on all packages in restructured text.
    def github_url(pkg):
        'Link    to    a    package    file    on    github.'
        url = 'https://github.com/LLNL/spack/blob/develop/var/spack/repos/builtin/packages/{0}/package.py'
        return url.format(pkg.name)
    def rst_table(elts):
        'Print    out    a    RST-style    table.'
        cols = StringIO()
        (ncol, widths) = colify(elts, output=cols, tty=True)
        header = '    '.join((('=' * (w - 1)) for w in widths))
        return ('%s\n%s%s' % (header, cols.getvalue(), header))
    pkg_names = pkgs
    pkgs = [spack.repo.get(name) for name in pkg_names]
    print('..    _package-list:')
    print()
    print('============')
    print('Package    List')
    print('============')
    print()
    print('This    is    a    list    of    things    you    can    install    using    Spack.        It    is')
    print('automatically    generated    based    on    the    packages    in    the    latest    Spack')
    print('release.')
    print()
    print(('Spack    currently    has    %d    mainline    packages:' % len(pkgs)))
    print()
    print(rst_table((('`%s`_' % p) for p in pkg_names)))
    print()
    for pkg in pkgs:
        print('-----')
        print()
        print(('..    _%s:' % pkg.name))
        print()
        print(('-' * max(len(pkg.name), 2)))
        print(pkg.name)
        print(('-' * max(len(pkg.name), 2)))
        print()
        print('Homepage:')
        print(('        *    `%s    <%s>`__' % (cgi.escape(pkg.homepage), pkg.homepage)))
        print()
        print('Spack    package:')
        print(('        *    `%s/package.py    <%s>`__' % (pkg.name, github_url(pkg))))
        print()
        if pkg.versions:
            print('Versions:')
            print(('        ' + ',    '.join((str(v) for v in reversed(sorted(pkg.versions))))))
            print()
        for deptype in spack.alldeps:
            deps = pkg.dependencies_of_type(deptype)
            if deps:
                print(('%s    Dependencies' % deptype.capitalize()))
               ...