boolean () { final PsiElement psiElement = myNode.getPsi(); final boolean isInStubFile = PyiUtil.isInsideStub(psiElement); if (psiElement instanceof PyStatementListContainer) { final PyStatement statement = PsiTreeUtil.getParentOfType(psiElement, PyStatement.class); if (statement != null) { final Collection<PyStatementPart> parts = PsiTreeUtil.collectElementsOfType(statement, PyStatementPart.class); return (parts.size() == 1 && myContext.getPySettings().NEW_LINE_AFTER_COLON && !isInStubFile) || (parts.size() > 1 && myContext.getPySettings().NEW_LINE_AFTER_COLON_MULTI_CLAUSE); } else { return myContext.getPySettings().NEW_LINE_AFTER_COLON && !isInStubFile; } } return false; }