code: def test_sliced_data_iterator_race_condition(
      num_of_slices, size, batch_size, shuffle
  ):
      from nnabla.utils.data_source_implements import CacheDataSource
      from nnabla.utils.data_iterator import data_iterator_cache
  
      with generate_cache_dir(size) as cache_dir:
          rng = np.random.RandomState(313)
          iterator = data_iterator_cache(
              cache_dir, batch_size, shuffle=True
          )
          sliced_it = iterator.slice(rng, num_of_slices, 1)
  
          for i in range(size + 5):
              d = sliced_it.next()
          sliced_it.close()
          iterator.close()
  
file_path: nnabla/python/test/utils/test_sliced_data_iterator.py
imports: import pytest
  import numpy
  import math
  from functools import partial
  from nnabla.utils.data_source_loader import load_image
  from nnabla.utils.data_iterator import data_iterator_simple
  from .test_data_iterator import check_data_iterator_result
  from .conftest import generate_cache_dir
label_desc: Use image node_id 3 for calling a global function with example usage: test_sliced_data_iterator_race_condition(num_of_slices, size, batch_size, shuffle) without return types