class_docstr: A proxy that represents a single shard instance within :class:`~gensim.similarity.docsim.Similarity` index.
  
  Basically just wraps :class:`~gensim.similarities.docsim.MatrixSimilarity`,
  :class:`~gensim.similarities.docsim.SparseMatrixSimilarity`, etc, so that it mmaps from disk on request (query).
class_docstr_tok: ["A","proxy","that","represents","a","single","shard","instance","within",":","class",":","`","~gensim.similarity.docsim.Similarity","`","index",".","Basically","just","wraps",":","class",":","`","~gensim.similarities.docsim.MatrixSimilarity","`",",",":","class",":","`","~gensim.similarities.docsim.SparseMatrixSimilarity","`",",","etc",",","so","that","it","mmaps","from","disk","on","request","(","query",")","."]
docstr: Parameters
  ----------
  fname : str
      Path to top-level directory (file) to traverse for corpus documents.
  index : :class:`~gensim.interfaces.SimilarityABC`
      Index object.
code: def __init__(self, fname, index):
      """
  
      Parameters
      ----------
      fname : str
          Path to top-level directory (file) to traverse for corpus documents.
      index : :class:`~gensim.interfaces.SimilarityABC`
          Index object.
  
      """
      self.dirname, self.fname = os.path.split(fname)
      self.length = len(index)
      self.cls = index.__class__
      logger.info("saving index shard to %s", self.fullname())
      index.save(self.fullname())
      self.index = self.get_index()
  
imports: import logging
  import itertools
  import os
  import heapq
  import warnings
  import numpy
  import scipy.sparse
  from gensim import interfaces, utils, matutils
label_desc: Use image node_id 1 to create a new Shard object from inherited base classes: utils with example: obj = Shard(fname, index)