private static boolean isMainClauseOnTopLevel(@NotNull PsiElement element) {
    if (element.getNode().getElementType() == PyTokenTypes.IF_KEYWORD) {
      PyIfStatement statement = PyIfStatementNavigator.getIfStatementByIfKeyword(element);
      return statement != null &&
             ScopeUtil.getScopeOwner(element) instanceof PyFile containingFile &&
             containingFile.getVirtualFile().getFileType() == PythonFileType.INSTANCE &&
             PyUtil.isIfNameEqualsMain(statement);
    }
    else {
      return false;
    }
  }
private static boolean isMainClauseOnTopLevel(@NotNull PsiElement element)