void (@NotNull final PyAssignmentStatement assignmentStatement, @NotNull final String newValue) { final PyExpression oldValue = assignmentStatement.getAssignedValue(); final PyExpression newExpression = PyElementGenerator.getInstance(assignmentStatement.getProject()).createExpressionFromText(LanguageLevel.forElement(assignmentStatement), newValue); if (oldValue != null) { oldValue.replace(newExpression); } else { assignmentStatement.add(newExpression); } }