void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement element = descriptor.getPsiElement(); if (element instanceof PyParenthesizedExpression) { PsiElement binaryExpression = ((PyParenthesizedExpression)element).getContainedExpression(); PyBinaryExpression parent = PsiTreeUtil.getParentOfType(element, PyBinaryExpression.class); if (binaryExpression instanceof PyBinaryExpression && parent != null) { if (!replaceBinaryExpression((PyBinaryExpression)binaryExpression)) { element.replace(binaryExpression); } } else { final PyExpression content = PyPsiUtils.flattenParens((PyParenthesizedExpression)element); if (content != null) { element.replace(content); } } } else if (element instanceof PyArgumentList) { LOG.assertTrue(element.getParent() instanceof PyClass, "Parent type: " + element.getParent().getClass()); LOG.assertTrue(((PyArgumentList)element).getArguments().length == 0, "Argument list: " + element.getText()); final ASTNode nameNode = PyElementGenerator.getInstance(project).createFromText( LanguageLevel.forElement(element), PyClass.class, "class A: pass").getNameNode(); if (nameNode != null) { final PsiElement emptyArgList = nameNode.getPsi().getNextSibling(); element.replace(emptyArgList); } else { element.delete(); } } }