code: def _escape(self, text):
          
          ret = EMPTYSTRING if text is None else str(text)
          if self.escape:
              return html_escape(ret)
          else:
              return ret
docs: Escape text according to self.escape