def make_printable(data):
    stream = io.StringIO()
    for ch in data:
        if (ch == '\\'):
            stream.write('\\\\')
        elif ((ch in '\n\r') or (32 <= ord(ch) <= 126)):
            stream.write(ch)
        else:
            stream.write('\\x{0:02x}'.format(ord(ch)))
    return stream.getvalue()
def make_printable(data):
    stream = io.StringIO()
    for ch in data:
        if (ch == '\\'):
            stream.write('\\\\')
        elif ((ch in '\n\r') or (32 <= ord(ch) <= 126)):
            stream.write(ch)
        else:
            stream.write('\\x{0:02x}'.format(ord(ch)))
    return stream.getvalue()