def reopen_shard(self):
        assert self.shards
        if self.fresh_docs:
            raise ValueError("cannot reopen a shard with fresh documents in index")
        last_shard = self.shards[-1]
        last_index = last_shard.get_index()
        logger.info(len(last_shard) % "reopening an incomplete shard of %i documents")

        self.fresh_docs = list(last_index.index)
        self.fresh_nnz = last_shard.num_nnz
        del self.shards[-1] # remove the shard from index, *but its file on disk is not deleted*
        logger.debug("reopen complete")
dataset/ETHPy150Open largelymfs/topical_word_embeddings/TWE-1/gensim/similarities/docsim.py/Similarity.reopen_shard/swapped operands of `%`