class_docstr: Create dataset cache from local file.
  
  If you want to create cache data from remote resource, use data_iterator_csv_dataset instead.
class_docstr_tok: ["Create","dataset","cache","from","local","file",".","If","you","want","to","create","cache","data","from","remote","resource",",","use","data_iterator_csv_dataset","instead","."]
code: def create(
      self,
      output_cache_dirname,
      normalize=True,
      cache_file_name_prefix="cache",
  ):
      self._normalize = normalize
      self._cache_file_name_prefix = cache_file_name_prefix
      self._cache_dir = output_cache_dirname
  
      self._cache_file_format = nnabla_config.get(
          "DATA_ITERATOR", "cache_file_format"
      )
      logger.info(
          "Cache file format is {}".format(self._cache_file_format)
      )
  
      progress(None)
  
      csv_position_and_data = []
      csv_row = []
      for _position in range(self._size):
          csv_row.append(self._csv_data[self._order[_position]])
          if len(csv_row) == self._cache_size:
              csv_position_and_data.append((_position, csv_row))
              csv_row = []
      if len(csv_row):
          csv_position_and_data.append((self._size - 1, csv_row))
  
      self.num_of_cache_file = len(csv_position_and_data)
      self.current_cache_position = 0
      if single_or_rankzero():
          progress("Create cache", 0)
      with closing(ThreadPool(processes=self._num_of_threads)) as pool:
          cache_index_rows = pool.map(
              self._save_cache, csv_position_and_data
          )
      if single_or_rankzero():
          progress("Create cache", 1.0)
  
      # Create Index
      index_filename = os.path.join(
          output_cache_dirname, "cache_index.csv"
      )
      with open(index_filename, "w") as f:
          writer = csv.writer(f, lineterminator="\n")
          for row in cache_index_rows:
              if row:
                  # row: (file_path, data_nums)
                  writer.writerow((os.path.basename(row[0]), row[1]))
  
      # Create Info
      if self._cache_file_format == ".npy":
          info_filename = os.path.join(
              output_cache_dirname, "cache_info.csv"
          )
          with open(info_filename, "w") as f:
              writer = csv.writer(f, lineterminator="\n")
              for variable in self._variables:
                  writer.writerow((variable,))
  
      # Create original.csv
      if self._original_source_uri is not None:
          shutil.copy(
              self._original_source_uri,
              os.path.join(output_cache_dirname, "original.csv"),
          )
  
      # Create order.csv
      if self._order is not None and self._original_order is not None:
          with open(
              os.path.join(output_cache_dirname, "order.csv"), "w"
          ) as o:
              writer = csv.writer(o, lineterminator="\n")
              for orders in zip(self._original_order, self._order):
                  writer.writerow(list(orders))
  
file_path: nnabla/python/src/nnabla/utils/create_cache.py
imports: import collections
  import csv
  import os
  import shutil
  from contextlib import closing
  from multiprocessing.pool import ThreadPool
  import h5py
  import numpy
  from nnabla.config import nnabla_config
  from nnabla.logger import logger
  from nnabla.utils.data_source_implements import CsvDataSource
  from nnabla.utils.data_source_loader import FileReader
  from nnabla.utils.progress import progress
  from nnabla.utils.communicator_util import single_or_rankzero
label_desc: Use image node_id 3 for calling the CreateCache obj's underlying member method code with example usage: obj.create(output_cache_dirname, normalize, cache_file_name_prefix) without return types