code: def test_build_batch_sampler(shape_files, type):
      if type == "foo":
          with pytest.raises(ValueError):
              build_batch_sampler(
                  batch_bins=60000,
                  batch_size=2,
                  shape_files=shape_files,
                  fold_lengths=[800, 40],
                  type=type,
              )
      else:
          sampler = build_batch_sampler(
              batch_bins=60000,
              batch_size=2,
              shape_files=shape_files,
              fold_lengths=[800, 40],
              type=type,
          )
          list(sampler)
  
imports: import pytest
  from espnet2.samplers.build_batch_sampler import build_batch_sampler
label_desc: Use image node_id 2 for calling a global function with example usage: test_build_batch_sampler(shape_files, type) without return types