Boolean (@NotNull PyExpression expression) { if (expression instanceof PyBoolLiteralExpression) { if (PyNames.DEBUG.equals(expression.getText())) { return null; } return ((PyBoolLiteralExpression)expression).getValue(); } else if (expression instanceof PyReferenceExpression && LanguageLevel.forElement(expression).isPython2()) { final String text = ((PyQualifiedExpression)expression).getReferencedName(); if (PyNames.TRUE.equals(text)) { return true; } if (PyNames.FALSE.equals(text)) { return false; } } return null; }