code: def test_out_of_core_sort_9503(monkeypatch: Any) -> None:
      monkeypatch.setenv("POLARS_FORCE_OOC", "1")
      np.random.seed(0)
  
      num_rows = 1_00_000
      num_columns = 2
      num_tables = 10
  
      # ensure we create many chunks
      # this will ensure we create more files
      # and that creates contention while dumping
      q = pl.concat(
          [
              pl.DataFrame(
                  [
                      pl.Series(
                          np.random.randint(0, 10000, size=num_rows)
                      )
                      for _ in range(num_columns)
                  ]
              )
              for _ in range(num_tables)
          ],
          rechunk=False,
      ).lazy()
      q = q.sort(q.columns)
      df = q.collect(streaming=True)
      assert df.shape == (1_000_000, 2)
      assert df["column_0"].flags["SORTED_ASC"]
      assert df.head(20).to_dict(as_series=False) == {
          "column_0": [
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
          ],
          "column_1": [
              242,
              245,
              588,
              618,
              732,
              902,
              925,
              945,
              1009,
              1161,
              1352,
              1365,
              1451,
              1581,
              1778,
              1836,
              1976,
              2091,
              2120,
              2124,
          ],
      }
  
file_path: polars/py-polars/tests/unit/streaming/test_streaming_sort.py
imports: from __future__ import annotations
  from datetime import datetime
  from typing import TYPE_CHECKING, Any
  from collections import Counter
  import numpy
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 5 for calling a global function with example usage: test_out_of_core_sort_9503(monkeypatch) without return types