code: def escape(self, text, quote = True):
          
          if isinstance(text, bytes):
              return escape_b(text, quote)
          else:
              return escape(text, quote)
docs: Escape special characters in HTML