private static boolean isUsedOutside(@NotNull PsiNamedElement element, @NotNull List<Instruction> subGraph) {
    final Set<PsiElement> subGraphElements = getSubGraphElements(subGraph);
    return ContainerUtil.exists(PyPsiIndexUtil.findUsages(element, false),
                                usageInfo -> !subGraphElements.contains(usageInfo.getElement()));
  }
private static boolean isUsedOutside(@NotNull PsiNamedElement element, @NotNull List<Instruction> subGraph)