code: def load_neighbour_info(self, cache_dir, mask=None, **kwargs):
          
          mask_name = getattr(mask, 'name', None)
          filename = self._create_cache_filename(cache_dir,
                                                 mask=mask_name, **kwargs)
          if kwargs.get('mask') in self._index_caches:
              self._apply_cached_indexes(self._index_caches[kwargs.get('mask')])
          elif cache_dir:
              cache = np.load(filename, mmap_mode='r')
              # copy the dict so we can modify it's keys
              new_cache = dict(cache.items())
              cache.close()
              self._apply_cached_indexes(new_cache)  # modifies cache dict in-place
              self._index_caches[mask_name] = new_cache
          else:
              raise IOError
docs: Read index arrays from either the in-memory or disk cache.