code: def test_max_batch_size():
      """Small batches are slow, large batches -> large allocations -> also slow.
  
      https://github.com/scikit-image/scikit-image/pull/6035#discussion_r751518691
      """
      coords = np.random.randint(low=0, high=1848, size=(40000, 2))
      tstart = time.time()
      ensure_spacing(
          coords, spacing=100, min_split_size=50, max_split_size=2000
      )
      dur1 = time.time() - tstart
  
      tstart = time.time()
      ensure_spacing(
          coords, spacing=100, min_split_size=50, max_split_size=20000
      )
      dur2 = time.time() - tstart
  
      # Originally checked dur1 < dur2 to assert that the default batch size was
      # faster than a much larger batch size. However, on rare occasion a CI test
      # case would fail with dur1 ~5% larger than dur2. To be more robust to
      # variable load or differences across architectures, we relax this here.
      assert dur1 < 1.33 * dur2
  
file_path: scikit-image/skimage/_shared/tests/test_coord.py
imports: import time
  import numpy
  import pytest
  from scipy.spatial.distance import pdist, minkowski
  from skimage._shared.coord import ensure_spacing
label_desc: Use image node_id 4 for calling a global function with example usage: test_max_batch_size() without return types