code: def generate_cache_dir(num_of_data):
      cache_block_size = 100
      with create_temp_with_dir("dummy.csv") as csvfilename:
          imgdir = os.path.dirname(csvfilename)
  
          # generate data
          data_x = numpy.random.random((num_of_data, 2, 2))
          data_y = numpy.random.randint(0, 10, size=(num_of_data,))
  
          cache_info = []
          for i in range(0, num_of_data, cache_block_size):
              npy_fn = os.path.join(
                  imgdir,
                  "cache_{}_{}.npy".format(
                      str(i).zfill(8),
                      str(i + cache_block_size - 1).zfill(8),
                  ),
              )
              with open(npy_fn, "wb") as f:
                  numpy.save(f, data_x[i : i + cache_block_size])
                  numpy.save(f, data_y[i : i + cache_block_size])
  
              cache_info.append(
                  (npy_fn, len(data_y[i : i + cache_block_size]))
              )
  
          # generate cache_index.csv
          with open(os.path.join(imgdir, "cache_index.csv"), "w") as f:
              for fn, num in cache_info:
                  f.write("{},{}\n".format(fn, str(num)))
  
          # generate cache_info.csv
          with open(os.path.join(imgdir, "cache_info.csv"), "w") as f:
              f.write("x\n")
              f.write("y\n")
  
          # generate order.csv
          with open(os.path.join(imgdir, "order.csv"), "w") as f:
              for i in range(num_of_data):
                  f.write("{},{}\n".format(i, i))
  
          print("start testing...")
          yield imgdir
          print("finished testing")
  
file_path: nnabla/python/test/utils/conftest.py
imports: from __future__ import print_function
  import pytest
  from contextlib import contextmanager
  from shutil import rmtree
  import numpy
  import os
  import tempfile
  import warnings
  from nnabla.utils.image_utils import imsave
label_desc: Use image node_id 8 for calling a global function with example usage: generate_cache_dir(num_of_data) without return types