code: def test_ChunkIterFactory_partial_chunking():
      dataset = Dataset2()
      collatefn = CommonCollateFn()
      batches = [["a"], ["b"]]
      iter_factory = ChunkIterFactory(
          dataset=dataset,
          batches=batches,
          batch_size=2,
          chunk_length=3,
          collate_fn=collatefn,
          excluded_key_prefixes=["aux"],
      )
  
      for key, batch in iter_factory.build_iter(0):
          for k, v in batch.items():
              if (
                  iter_factory.excluded_key_pattern is not None
                  and re.fullmatch(iter_factory.excluded_key_pattern, k)
              ):
                  assert v.shape in ((2, 2), (2, 4))
              else:
                  assert v.shape == (2, 3)
  
file_path: espnet/test/espnet2/iterators/test_chunk_iter_factory.py
imports: import re
  import numpy
  import pytest
  from espnet2.iterators.chunk_iter_factory import ChunkIterFactory
  from espnet2.train.collate_fn import CommonCollateFn
label_desc: Use image node_id 2 for calling a global function with example usage: test_ChunkIterFactory_partial_chunking() without return types