def escape(string, quote=False):
    if string is None:
        return ''
    elif hasattr(string, '__html__'):
        return unicode(string)
    string = string.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')
    if quote:
        string = string.replace('"', "&quot;")
    return string
Calling C{patch()} on a test monkey patches the specified object and
dataset/ETHPy150Open quokkaproject/flask-htmlbuilder/flaskext/htmlbuilder.py/escape--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/trial/test/test_tests.py/TestMonkeyPatchSupport.test_patch