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: Get similarities of document (or corpus) `query` to all documents in the corpus.
  
  Parameters
  ----------
  query : {iterable of list of (int, number) , list of (int, number))}
      Document or corpus.
  
  Returns
  -------
  :class:`numpy.ndarray`
      Similarities of document/corpus if index is :class:`~gensim.similarities.docsim.MatrixSimilarity` **or**
  :class:`scipy.sparse.csr_matrix`
      for case if index is :class:`~gensim.similarities.docsim.SparseMatrixSimilarity`.
code: def __getitem__(self, query):
      """Get similarities of document (or corpus) `query` to all documents in the corpus.
  
      Parameters
      ----------
      query : {iterable of list of (int, number) , list of (int, number))}
          Document or corpus.
  
      Returns
      -------
      :class:`numpy.ndarray`
          Similarities of document/corpus if index is :class:`~gensim.similarities.docsim.MatrixSimilarity` **or**
      :class:`scipy.sparse.csr_matrix`
          for case if index is :class:`~gensim.similarities.docsim.SparseMatrixSimilarity`.
  
      """
      index = self.get_index()
      try:
          index.num_best = self.num_best
          index.normalize = self.normalize
      except Exception:
          raise ValueError(
              "num_best and normalize have to be set before querying a proxy Shard object"
          )
      return index[query]
  
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 8 for calling the Shard obj's underlying member method code with example usage: obj.__getitem__(query) and returns: index