human
Complete this python program:
def _render_to_html(tree):
assistant
#Here is the Python code you requested.

    """Renders a cleaned tree to HTML
    """
    def molecule_count(tree, children):
        if (len(tree) == 1):
            return tree[0][0]
        if (len(tree) == 3):
            return '    <sup>{num}</sup>&frasl;<sub>{den}</sub>    '.format(num=tree[0][0], den=tree[2][0])
        return 'Error'
    def subscript(tree, children):
        return '<sub>{sub}</sub>'.format(sub=children)
    def superscript(tree, children):
        return '<sup>{sup}</sup>'.format(sup=children)
    def round_brackets(tree, children):
        return '({insider})'.format(insider=children)
    def square_brackets(tree, children):
        return '[{insider}]'.format(insider=children)
    dispatch = {'count': molecule_count, 'number_suffix': subscript, 'ion_suffix': superscript, 'paren_group_round': round_brackets, 'paren_group_square': square_brackets}
    if isinstance(tree, str):
        return tree
    else:
        children = ''.join(map(_render_to_html, tree))
        if (tree.node in dispatch):
            return dispatch[tree.node](tree, children)
        else:
            return children.replace('    ', '')