private boolean needLineBreakInStatement() {
    final PsiElement psiElement = myNode.getPsi();
    final boolean isInStubFile = PyiUtilCore.isInsideStub(psiElement);
    if (psiElement instanceof PyAstStatementListContainer) {
      final PyAstStatement statement = PsiTreeUtil.getParentOfType(psiElement, PyAstStatement.class);
      if (statement != null) {
        final Collection<PyAstStatementPart> parts = PsiTreeUtil.collectElementsOfType(statement, PyAstStatementPart.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;
  }
private boolean needLineBreakInStatement()