private static boolean processDeclarations(@NotNull List<PsiElement> elements, @NotNull Processor<? super PsiElement> processor) {
      for (PsiElement child : elements) {
        if (!processor.process(child)) {
          return false;
        }
        if (child instanceof PyExceptPart part) {
          if (!processDeclarations(PyPsiUtils.collectAllStubChildren(part, part.getStub()), processor)) {
            return false;
          }
        }
      }
      return true;
    }
private static boolean processDeclarations(@NotNull List<PsiElement> elements, @NotNull Processor<? super PsiElement> processor)