def clampParenTrailToCursor(result):
    startX = result['parenTrail']['startX']
    endX = result['parenTrail']['endX']

    isCursorClamping = (isCursorOnRight(result, startX) and
                        not isCursorInComment(result))

    if isCursorClamping:
        newStartX = max(startX, result['cursorX'])
        newEndX = max(endX, result['cursorX'])

        line = result['lines'][result['lineNo']]
        removeCount = 0
        for i in range(startX, newStartX):
            if CLOSE_PARENS in line[i]:
                removeCount = removeCount + 1

        for i in range(removeCount):
            result['parenTrail']['openers'].pop(0)
        result['parenTrail']['startX'] = newStartX
        result['parenTrail']['endX'] = newEndX
dataset/ETHPy150Open oakmac/sublime-text-parinfer/parinfer.py/clampParenTrailToCursor/swapped operands of `in`