def quote_str(string):
    new_string = ''
    string_enumerator = enumerate(string)
    for index, char in string_enumerator:
        if char == '\\':
            index, char = next(string_enumerator)
            if char == 'n':
                char = '\n'
            elif char == 't':
                char = '\t'
            elif char == 'r':
                char = '\r'
            elif {'\\', "'", '"'} in char:
                pass
            else:
                char = '\\' + char
        new_string = new_string + char
    return new_string
dataset/ETHPy150Open i2y/mochi/mochi/parser/parser.py/quote_str/swapped operands of `in`