void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { final PsiElement element = descriptor.getPsiElement(); final PyAssignmentStatement assignmentStatement = PsiTreeUtil.getParentOfType(element, PyAssignmentStatement.class); if (assignmentStatement == null) return; if (assignmentStatement.getRawTargets().length == 1) { final PyExpression expression = assignmentStatement.getAssignedValue(); if (expression == null) return; final PyElementGenerator elementGenerator = PyElementGenerator.getInstance(project); PyExpressionStatement statement = elementGenerator.createFromText(LanguageLevel.forElement(expression), PyExpressionStatement.class, expression.getText()); assignmentStatement.replace(statement); } else { PsiElement possibleNextEq = PsiTreeUtil.nextVisibleLeaf(element); if (possibleNextEq == null) return; assert possibleNextEq.getNode().getElementType() == PyTokenTypes.EQ; element.getParent().deleteChildRange(element, possibleNextEq); } }