PsiElement (@NotNull PsiElement element) { String newText = element instanceof PyBinaryExpression ? "(" + element.getText() + ")" : element.getText(); return PyElementGenerator.getInstance(element.getProject()). createExpressionFromText(LanguageLevel.forElement(element), "not " + newText); }