boolean (@Nullable PsiElement target) { if (target == null) return false; PyPsiUtils.assertValid(target); if (!target.isValid()) return false; final PsiFile the_file = target.getContainingFile(); if (!(the_file instanceof PyFile)) { return false; } // files are singletons, no need to compare URIs return the_file == myBuiltinsFile || the_file == myExceptionsFile; }