private static boolean inStatementList(final @NotNull PsiFile file, int caretOffset) {
    final PsiElement element = file.findElementAt(caretOffset);
    return PsiTreeUtil.getParentOfType(element, PyStatementListContainer.class) != null;
  }
private static boolean inStatementList(final @NotNull PsiFile file, int caretOffset)