void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement binaryExpression = descriptor.getPsiElement(); if (binaryExpression instanceof PyBinaryExpression) { PsiElement operator = ((PyBinaryExpression)binaryExpression).getPsiOperator(); if (operator != null) { PyElementGenerator elementGenerator = PyElementGenerator.getInstance(project); operator.replace(elementGenerator.createFromText(LanguageLevel.forElement(binaryExpression), LeafPsiElement.class, "!=")); } } }