class_docstr: Compute cosine similarity of a dynamic query against a corpus of documents ('the index').
  
  The index supports adding new documents dynamically.
  
  Notes
  -----
  Scalability is achieved by sharding the index into smaller pieces, each of which fits into core memory
  The shards themselves are simply stored as files to disk and mmap'ed back as needed.
  
  Examples
  --------
  .. sourcecode:: pycon
  
      >>> from gensim.corpora.textcorpus import TextCorpus
      >>> from gensim.test.utils import datapath, get_tmpfile
      >>> from gensim.similarities import Similarity
      >>>
      >>> corpus = TextCorpus(datapath('testcorpus.mm'))
      >>> index_temp = get_tmpfile("index")
      >>> index = Similarity(index_temp, corpus, num_features=400)  # create index
      >>>
      >>> query = next(iter(corpus))
      >>> result = index[query]  # search similar to `query` in index
      >>>
      >>> for sims in index[corpus]:  # if you have more query documents, you can submit them all at once, in a batch
      ...     pass
      >>>
      >>> # There is also a special syntax for when you need similarity of documents in the index
      >>> # to the index itself (i.e. queries=indexed documents themselves). This special syntax
      >>> # uses the faster, batch queries internally and **is ideal for all-vs-all pairwise similarities**:
      >>> for similarities in index:  # yield similarities of the 1st indexed document, then 2nd...
      ...     pass
  
  See Also
  --------
  :class:`~gensim.similarities.docsim.MatrixSimilarity`
      Index similarity (dense with cosine distance).
  :class:`~gensim.similarities.docsim.SparseMatrixSimilarity`
      Index similarity (sparse with cosine distance).
  :class:`~gensim.similarities.docsim.WmdSimilarity`
      Index similarity (with word-mover distance).
class_docstr_tok: ["Compute","cosine","similarity","of","a","dynamic","query","against","a","corpus","of","documents","(","'the","index","'",")",".","The","index","supports","adding","new","documents","dynamically",".","Notes","--","--","-","Scalability","is","achieved","by","sharding","the","index","into","smaller","pieces",",","each","of","which","fits","into","core","memory","The","shards","themselves","are","simply","stored","as","files","to","disk","and","mmap'ed","back","as","needed",".","Examples","--","--","--","--","..","sourcecode",":",":","pycon",">",">",">","from","gensim.corpora.textcorpus","import","TextCorpus",">",">",">","from","gensim.test.utils","import","datapath",",","get_tmpfile",">",">",">","from","gensim.similarities","import","Similarity",">",">",">",">",">",">","corpus","=","TextCorpus","(","datapath","(","'testcorpus.mm","'",")",")",">",">",">","index_temp","=","get_tmpfile","(","``","index","''",")",">",">",">","index","=","Similarity","(","index_temp",",","corpus",",","num_features=400",")","#","create","index",">",">",">",">",">",">","query","=","next","(","iter","(","corpus",")",")",">",">",">","result","=","index","[","query","]","#","search","similar","to","`","query","`","in","index",">",">",">",">",">",">","for","sims","in","index","[","corpus","]",":","#","if","you","have","more","query","documents",",","you","can","submit","them","all","at","once",",","in","a","batch","...","pass",">",">",">",">",">",">","#","There","is","also","a","special","syntax","for","when","you","need","similarity","of","documents","in","the","index",">",">",">","#","to","the","index","itself","(","i.e",".","queries=indexed","documents","themselves",")",".","This","special","syntax",">",">",">","#","uses","the","faster",",","batch","queries","internally","and","*","*","is","ideal","for","all-vs-all","pairwise","similarities","*","*",":",">",">",">","for","similarities","in","index",":","#","yield","similarities","of","the","1st","indexed","document",",","then","2nd","...","...","pass","See","Also","--","--","--","--",":","class",":","`","~gensim.similarities.docsim.MatrixSimilarity","`","Index","similarity","(","dense","with","cosine","distance",")",".",":","class",":","`","~gensim.similarities.docsim.SparseMatrixSimilarity","`","Index","similarity","(","sparse","with","cosine","distance",")",".",":","class",":","`","~gensim.similarities.docsim.WmdSimilarity","`","Index","similarity","(","with","word-mover","distance",")","."]
docstr: Update shard locations, for case where the server prefix location changed on the filesystem.
code: def check_moved(self):
      """Update shard locations, for case where the server prefix location changed on the filesystem."""
      dirname = os.path.dirname(self.output_prefix)
      for shard in self.shards:
          shard.dirname = dirname
  
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 14 for calling the Similarity obj's underlying member method code with example usage: obj.check_moved() without return types