code: def unescape(s, quote=False):
      
      s = s.replace('&lt;', '<')
      s = s.replace('&gt;', '>')
      if quote:
          s = s.replace('&quot;', '"')
      s = s.replace('&amp;', '&')
      return s
docs: The opposite of the cgi.escape function.
      Replace escaped characters '&amp;', '&lt;' and '&gt;' with the corresponding
      regular characters. If the optional flag quote is true, the escaped quotation
      mark character ('&quot;') is also translated.