boolean (@NotNull PsiElement definition, @NotNull ScopeOwner definitionScope, @Nullable ScopeOwner referenceScope) { return definitionScope instanceof PyClass pyClass && pyClass != referenceScope && !(definition instanceof PyTypeParameter); }