BUG:  examples\applications\plot_out_of_core_classification.py breaks with StopIteration error

### Describe the bug

I was building the documentation from source, following [The contributing Tutorial](https://scikit-learn.org/stable/developers/contributing.html#documentation).

When I ran the command `make html`, I noticed the following error from Sphinx build:

```
Extension error:
Here is a summary of the problems encountered when running the examples:

Unexpected failing examples (1):

    ..\examples\applications\plot_out_of_core_classification.py failed leaving traceback:

    Traceback (most recent call last):
      File "C:\Users\vitor.pohlenz\vpz\scikit-learn\examples\applications\plot_out_of_core_classification.py", line 252, in <module>
        X_test = vectorizer.transform(X_test_text)
      File "C:\Users\vitor.pohlenz\vpz\scikit-learn\sklearn\feature_extraction\text.py", line 878, in transform
        X = self._get_hasher().transform(analyzer(doc) for doc in X)
      File "C:\Users\vitor.pohlenz\vpz\scikit-learn\sklearn\utils\_set_output.py", line 316, in wrapped
        data_to_wrap = f(self, X, *args, **kwargs)
      File "C:\Users\vitor.pohlenz\vpz\scikit-learn\sklearn\feature_extraction\_hash.py", line 175, in transform
        first_raw_X = next(raw_X)
    StopIteration

-------------------------------------------------------------------------------

Build finished. The HTML pages are in _build/html.
```

[Here is the full log of the build](https://gist.github.com/vitorpohlenz/2367944e20a0c05b29225631dbdaeb82)

It seems that the `raw_X` varible is empty.

Also when running the file `examples\applications\plot_out_of_core_classification.py` directly in the python environment we get the same error.

### Steps/Code to Reproduce

The simple way to reproduce is just to run the file `plot_out_of_core_classification.py` in the sklearn-env.

1. Activate sklearn-env
2. Supposing that you are in the folder `scikit-learn`, run:
`python examples\applications\plot_out_of_core_classification.py`

Alternatively, you may enter the `doc` folder, and execute `make html` for building the entire documentation.

### Expected Results

The plot should be displayed when running the file, and saved when building the documentation.

### Actual Results

When running directly `python examples\applications\plot_out_of_core_classification.py ` in the Python sklearn-env.
I also get the same error:

```
Traceback (most recent call last):
  File "C:\Users\vitor.pohlenz\vpz\scikit-learn\examples\applications\plot_out_of_core_classification.py", line 252, in <module>        
    X_test = vectorizer.transform(X_test_text)
  File "C:\Users\vitor.pohlenz\vpz\scikit-learn\sklearn\feature_extraction\text.py", line 878, in transform
    X = self._get_hasher().transform(analyzer(doc) for doc in X)
  File "C:\Users\vitor.pohlenz\vpz\scikit-learn\sklearn\utils\_set_output.py", line 316, in wrapped
    data_to_wrap = f(self, X, *args, **kwargs)
  File "C:\Users\vitor.pohlenz\vpz\scikit-learn\sklearn\feature_extraction\_hash.py", line 175, in transform
    first_raw_X = next(raw_X)
StopIteration
```

### Versions

```shell
System:
    python: 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
executable: C:\Users\vitor.pohlenz\vpz\scikit-learn\sklearn-env\Scripts\python.exe
   machine: Windows-10-10.0.26100-SP0

Python dependencies:
      sklearn: 1.7.dev0
          pip: 25.0.1
   setuptools: 65.5.0
        numpy: 2.2.4
        scipy: 1.15.2
       Cython: 3.0.12
       pandas: 2.2.3
   matplotlib: 3.10.1
       joblib: 1.4.2
threadpoolctl: 3.6.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 20
         prefix: libscipy_openblas
       filepath: C:\Users\vitor.pohlenz\vpz\scikit-learn\sklearn-env\Lib\site-packages\numpy.libs\libscipy_openblas64_-43e11ff0749b8cbe0a615c9cf6737e0e.dll
        version: 0.3.28
threading_layer: pthreads
   architecture: Haswell

       user_api: blas
   internal_api: openblas
    num_threads: 20
         prefix: libscipy_openblas
       filepath: C:\Users\vitor.pohlenz\vpz\scikit-learn\sklearn-env\Lib\site-packages\scipy.libs\libscipy_openblas-f07f5a5d207a3a47104dca54d6d0c86a.dll
        version: 0.3.28
threading_layer: pthreads
   architecture: Haswell

       user_api: openmp
   internal_api: openmp
    num_threads: 20
         prefix: vcomp
       filepath: C:\Windows\System32\vcomp140.dll
        version: None
```

COMMENT:
Fixed in #31186

Labels: Bug, Documentation