code: def decode_html_entities(s):
      
      parser = HTMLParser.HTMLParser()
  
      def unesc(m):
          return parser.unescape(m.group())
      return re.sub(r'(&[^;]+;)', unesc, ensure_unicode(s))
docs: Replaces html entities with the character they represent.
  
          >>> print(decode_html_entities("&lt;3 &amp;"))
          <3 &