code: def escape(s, quote=True):
      
      assert not isinstance(s, bytes), 'Pass a unicode string'
      if quote:
          return s.translate(_escape_map_full)
      return s.translate(_escape_map)
docs: Replace special characters "&", "<" and ">" to HTML-safe sequences.
      If the optional flag quote is true (the default), the quotation mark
      characters, both double quote (") and single quote (') characters are also
      translated.