human
Complete the below
def escape(text):

    ''''Use XML character references to escape characters.
    Use XML character references for unprintable or non-ASCII
    characters, double quotes and ampersands in a string'
    '''

=====
Give me a the Python program you requested?
assistant
#Here is the Python program you requested.
    def fixup(m):
        ch = m.group(0)
        return (('&#' + str(ord(ch))) + ';')
    text = re.sub('[^    -~]|[&"]', fixup, text)
    return (text if isinstance(text, str) else str(text))