code: def unescape(s):
      
      def handle_match(m):
          name = m.group(1)
          if name in HTMLBuilder._entities:
              return unichr(HTMLBuilder._entities[name])
          try:
              if name[:2] in ('#x', '#X'):
                  return unichr(int(name[2:], 16))
              elif name.startswith('#'):
                  return unichr(int(name[1:]))
          except ValueError:
              pass
          return u''
      return _entity_re.sub(handle_match, s)
docs: The reverse function of `escape`.  This unescapes all the HTML
      entities, not only the XML entities inserted by `escape`.
  
      :param s: the string to unescape.