code: def test_util_minibatch_oversize(doc_sizes, expected_batches):
      """Test that oversized documents are returned in their own batch"""
      docs = [get_random_doc(doc_size) for doc_size in doc_sizes]
      tol = 0.2
      batch_size = 1000
      batches = list(
          minibatch_by_words(
              docs,
              size=batch_size,
              tolerance=tol,
              discard_oversize=False,
          )
      )
      assert [len(batch) for batch in batches] == expected_batches
  
imports: import ctypes
  import os
  from pathlib import Path
  import pytest
  from thinc.api import Config, ConfigValidationError, CupyOps, MPSOps, NumpyOps, Optimizer, get_current_ops, set_current_ops
  from thinc.compat import has_cupy_gpu, has_torch_mps_gpu
  from spacy import prefer_gpu, require_cpu, require_gpu, util
  from spacy.about import __version__
  from spacy.lang.en import English
  from spacy.lang.nl import Dutch
  from spacy.language import DEFAULT_CONFIG_PATH
  from spacy.ml._precomputable_affine import PrecomputableAffine, _backprop_precomputable_affine_padding
  from spacy.schemas import ConfigSchemaTraining, TokenPattern, TokenPatternSchema
  from spacy.training.batchers import minibatch_by_words
  from spacy.util import SimpleFrozenList, dot_to_object, find_available_port, import_file, to_ternary_int
  from .util import get_random_doc, make_tempdir
label_desc: Use image node_id 20 for calling a global function with example usage: test_util_minibatch_oversize(doc_sizes, expected_batches) without return types