class_docstr: Get data from file cache directly.
code: def __init__(
      self, cachedir, shuffle=False, rng=None, normalize=False
  ):
      super(CacheDataSource, self).__init__(shuffle=shuffle, rng=rng)
  
      self._current_data = {}
      self._current_filename = None
  
      self._cachedir = cachedir
      self._normalize = normalize
      self._filereader = FileReader(self._cachedir)
      self._num_of_threads = int(
          nnabla_config.get(
              "DATA_ITERATOR", "cache_file_cache_num_of_threads"
          )
      )
      self._variables = None
  
      self._generation = -1
      self._cache_files = []
      self._max_length = 1
  
      info_filename = os.path.join(self._cachedir, "cache_info.csv")
      self.initialize_cache_info(info_filename)
  
      index_filename = os.path.join(self._cachedir, "cache_index.csv")
      self.initialize_cache_files_with_index(index_filename)
  
      logger.info("{}".format(len(self._cache_files)))
  
      self._cache_reader_with_prefetch = CacheReaderWithPrefetch(
          self._cachedir, self._num_of_threads, self._variables
      )
      self._thread_lock = threading.Lock()
  
      self._original_order = []
      for i in range(len(self._cache_files)):
          filename, length = self._cache_files[i]
          for j in range(length):
              self._original_order.append((filename, j))
  
      self.reset()
  
imports: import atexit
  import csv
  import os
  import threading
  from collections import OrderedDict, deque
  from time import sleep
  import numpy
  from nnabla.config import nnabla_config
  from nnabla.logger import logger
  from nnabla.utils.communicator_util import current_communicator
  from six.moves import queue
  from .data_source import DataSource
  from .data_source_loader import FileReader, load
label_desc: Use image node_id 6 to create a new CacheDataSource object from inherited base classes: DataSource with example: obj = CacheDataSource(cachedir, shuffle, rng, normalize)