def updateString(string_node):
    # Skip doc strings for now.
    if not hasattr( node.parent, "type") or \
       string_node.parent.type in ("class", "def", None):
        return

    value = string_node.value

    def isQuotedWith(quote):
        return value.startswith(quote) and value.endswith(quote)

    for quote in "'''", '"""', "'", '"':
        if isQuotedWith(quote):
            break
    else:
        assert False, value

    real_value = value[len(quote):-len(quote)]
    assert quote + real_value + quote == value

    if real_value not in '\n':
        # Single characters, should be quoted with "'"
        if len(eval(value)) == 1:
            if real_value != "'":
                string_node.value = "'" + real_value + "'"
        else:
            if '"' not in real_value:
                string_node.value = '"' + real_value + '"'
dataset/ETHPy150Open kayhayen/Nuitka/misc/autoformat.py/updateString/swapped operands of `not in`