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