boolean (@NotNull PsiElement elem) { if (elem instanceof PyCallExpression) { final PyArgumentList argumentList = ((PyCallExpression)elem).getArgumentList(); return argumentList != null && hasHangingIndent(argumentList); } else if (elem instanceof PyFunction) { return hasHangingIndent(((PyFunction)elem).getParameterList()); } final PsiElement firstChild; if (elem instanceof PyFromImportStatement) { firstChild = ((PyFromImportStatement)elem).getLeftParen(); } else if (elem instanceof PyWithStatement) { firstChild = PyPsiUtils.getFirstChildOfType(elem, PyTokenTypes.LPAR); } else { firstChild = elem.getFirstChild(); } if (firstChild == null) { return false; } final IElementType elementType = elem.getNode().getElementType(); final ASTNode firstChildNode = firstChild.getNode(); if (ourHangingIndentOwners.contains(elementType) && PyTokenTypes.OPEN_BRACES.contains(firstChildNode.getElementType())) { if (hasLineBreakAfterIgnoringComments(firstChildNode)) { return true; } final PsiElement firstItem = getFirstItem(elem); if (firstItem == null) { return !PyTokenTypes.CLOSE_BRACES.contains(elem.getLastChild().getNode().getElementType()); } else { if (firstItem instanceof PyNamedParameter) { final PyExpression defaultValue = ((PyNamedParameter)firstItem).getDefaultValue(); return defaultValue != null && hasHangingIndent(defaultValue); } else if (firstItem instanceof PyKeywordArgument) { final PyExpression valueExpression = ((PyKeywordArgument)firstItem).getValueExpression(); return valueExpression != null && hasHangingIndent(valueExpression); } else if (firstItem instanceof PyKeyValueExpression) { final PyExpression value = ((PyKeyValueExpression)firstItem).getValue(); return value != null && hasHangingIndent(value); } else if (firstItem instanceof PyWithItem) { PyExpression contextExpression = ((PyWithItem)firstItem).getExpression(); return hasHangingIndent(contextExpression); } return hasHangingIndent(firstItem); } } else { return false; } }