boolean (@NotNull PsiElement e) { if (e instanceof PyForStatement forStatement) { final PyStatementList statementList = forStatement.getForPart().getStatementList(); final PyStatement[] statements = statementList.getStatements(); return statements.length == 1 && !(statements[0] instanceof PyPassStatement) || statements.length > 1; } return false; }