def _escapify(qstring):
    'Escape the characters in a quoted string which need it.\n\n    @param qstring: the string\n    @type qstring: string\n    @returns: the escaped string\n    @rtype: string\n    '
    if isinstance(qstring, text_type):
        qstring = qstring.encode()
    if (not isinstance(qstring, bytearray)):
        qstring = bytearray(qstring)
    text = ''
    for c in qstring:
        if (c in __escaped):
            text += ('\\' + chr(c))
        elif ((c >= 32) and (c < 127)):
            text += chr(c)
        else:
            text += ('\\%03d' % c)
    return text
Escape the characters in a quoted string which need it.

@param qstring: the string
@type qstring: string
@returns: the escaped string
@rtype: string
def _escapify(qstring):
    'Escape the characters in a quoted string which need it.\n\n    @param qstring: the string\n    @type qstring: string\n    @returns: the escaped string\n    @rtype: string\n    '
    if isinstance(qstring, text_type):
        qstring = qstring.encode()
    if (not isinstance(qstring, bytearray)):
        qstring = bytearray(qstring)
    text = 
    for c in qstring:
        if (c in __escaped):
            text += ('\\' + chr(c))
        elif ((c >= 32) and (c < 127)):
            text += chr(c)
        else:
            text += ('\\%03d' % c)
    return text