human
Complete the below
def clean_html(text):

    ''''Clean the given HTML.  Specifically, do the following:
    * Convert <b> and <i> to <strong> and <em>.
    * Encode all ampersands correctly.
    * Remove all "target" attributes from <a> tags.
    * Remove extraneous HTML, such as presentational tags that open and
    immediately close and <br clear="all">.
    * Convert hard-coded bullets into HTML unordered lists.
    * Remove stuff like "<p>&nbsp;&nbsp;</p>", but only if it\'s at the
    bottom of the text.'
    '''

=====
Can you provide a the Python program you requested?
assistant
#Here is the Python program you requested.
    from django.utils.text import normalize_newlines
    text = normalize_newlines(force_unicode(text))
    text = re.sub('<(/?)\\s*b\\s*>', '<\\1strong>', text)
    text = re.sub('<(/?)\\s*i\\s*>', '<\\1em>', text)
    text = fix_ampersands(text)
    text = link_target_attribute_re.sub('\\1', text)
    text = html_gunk_re.sub('', text)
    def replace_p_tags(match):
        s = match.group().replace(u'</p>', u'</li>')
        for d in DOTS:
            s = s.replace((u'<p>%s' % d), u'<li>')
        return (u'<ul>\n%s\n</ul>' % s)
    text = hard_coded_bullets_re.sub(replace_p_tags, text)
    text = trailing_empty_content_re.sub(u'', text)
    return text