boolean (@NotNull PsiElement ref) { PsiElement navFile = ref.getNavigationElement().getContainingFile(); return (navFile instanceof PyFile && BUILTINS_MODULES.contains(navFile.getContainingFile().getName()) || navFile instanceof PyiFile); }