<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _escape(self, text):
 """Escape text according to self.escape"""

        ret = EMPTYSTRING if text is None else str(text)
        if self.escape:
            return html_escape(ret)
        else:
            return ret