boolean (@NotNull Project project, Editor editor, PsiFile file) { if (!(file instanceof PyFile)) { return false; } PsiElement element = file.findElementAt(editor.getCaretModel().getOffset()); PyBinaryExpression binaryExpression = PsiTreeUtil.getParentOfType(element, PyBinaryExpression.class, false); Pair<String, String> negation = ConditionUtil.findComparisonNegationOperators(binaryExpression); if (negation != null) { setText(PyPsiBundle.message("INTN.negate.comparison", negation.component1(), negation.component2())); return true; } return false; }