code: def test_make_batchset(swap_io):
      dummy_json = make_dummy_json(128, [128, 512], [16, 128])
      # check w/o adaptive batch size
      batchset = make_batchset(
          dummy_json,
          24,
          2**10,
          2**10,
          min_batch_size=1,
          swap_io=swap_io,
      )
      assert sum([len(batch) >= 1 for batch in batchset]) == len(
          batchset
      )
      print([len(batch) for batch in batchset])
      batchset = make_batchset(
          dummy_json,
          24,
          2**10,
          2**10,
          min_batch_size=10,
          swap_io=swap_io,
      )
      assert sum([len(batch) >= 10 for batch in batchset]) == len(
          batchset
      )
      print([len(batch) for batch in batchset])
  
      # check w/ adaptive batch size
      batchset = make_batchset(
          dummy_json, 24, 256, 64, min_batch_size=10, swap_io=swap_io
      )
      assert sum([len(batch) >= 10 for batch in batchset]) == len(
          batchset
      )
      print([len(batch) for batch in batchset])
      batchset = make_batchset(
          dummy_json, 24, 256, 64, min_batch_size=10, swap_io=swap_io
      )
      assert sum([len(batch) >= 10 for batch in batchset]) == len(
          batchset
      )
  
file_path: espnet/test/test_utils.py
imports: from test.utils_test import make_dummy_json
  import h5py
  import kaldiio
  import numpy
  import pytest
  from espnet.utils.io_utils import LoadInputsAndTargets, SoundHDF5File
  from espnet.utils.training.batchfy import make_batchset
label_desc: Use image node_id 1 for calling a global function with example usage: test_make_batchset(swap_io) without return types