def generate_html(output_filename, tree, my_index, info, path, footer=""):
    """Generate HTML for a tree node.

    ``output_filename`` is the output file name.

    ``tree`` is the root node of the tree.

    ``my_index`` is the path of the node for which you are generating this HTML
    file.

    ``info`` is a list of paths of child nodes.

    ``path`` is the directory name for the plain-text report files.
    """
    html = open(output_filename, 'w')
    print({'name': index_to_name(my_index)} % HEADER, file=html)
    info = [(tree.get_at(node_path), node_path) for node_path in info]
    def key(node_info):
        (node, node_path) = node_info
        return (len(node_path), -node.uncovered, node_path and node_path[-1])
    info.sort(key=key)
    for node, file_index in info:
        if not file_index:
            continue # skip root node
        print_table_row(html, node, file_index)
    print('</table><hr/>', file=html)
    print(tree.get_at(my_index).html_source, file=html)
    print(FOOTER % footer, file=html)
    html.close()
dataset/ETHPy150Open dnanexus/dx-toolkit/src/python/test/coveragereport.py/generate_html/swapped operands of `%`