String (@NotNull PsiElement anchor) { if (anchor instanceof PsiFile) { return ""; } final PyStatementList statementList = getAnchorStatementList(anchor); if (statementList == null) { return ""; } final PsiElement prevSibling = statementList.getPrevSibling(); final String whitespace = prevSibling instanceof PsiWhiteSpace ? prevSibling.getText() : ""; final int i = whitespace.lastIndexOf("\n"); if (i >= 0 && statementList.getStatements().length != 0) { return whitespace.substring(i + 1); } else { return getExpectedBlockIndent(statementList); } }