PyStatementListContainer (@NotNull PsiFile file, int offset) { final PsiWhiteSpace whitespace = findWhitespaceAtCaret(file, offset); if (whitespace == null) { return null; } final PsiElement prevLeaf = getPrevNonCommentLeaf(whitespace); return PsiTreeUtil.getParentOfType(prevLeaf, PyStatementListContainer.class); }