boolean (@NotNull final PyElement element, final FQNamesProvider @NotNull ... namesProviders) { assert element.isValid(); final Pair<String, String> qualifiedAndClassName = RecursionManager.doPreventingRecursion(element, false, () -> QUALIFIED_AND_CLASS_NAME .getValue(element)); LOG.assertTrue(qualifiedAndClassName != null); //noinspection ConstantConditions if (qualifiedAndClassName == null) return false; final String qualifiedName = qualifiedAndClassName.first; final String className = qualifiedAndClassName.second; for (final FQNamesProvider provider : namesProviders) { final List<String> names = Arrays.asList(provider.getNames()); if (qualifiedName != null && names.contains(qualifiedName)) { return true; } if (className != null && provider.isClass() && names.contains(className)) { return true; } } return false; }