@gensim.utils.synchronous('<STR_LIT>')<EOL><INDENT>def buffer(self, documents):<DEDENT>
logger.info("<STR_LIT>" % (self))<EOL>for doc in documents:<EOL><INDENT>docid = doc['<STR_LIT:id>']<EOL><INDENT>logger.debug("<STR_LIT>" % docid)<EOL><DEDENT>if docid in self.fresh_docs:<EOL><INDENT>logger.warning("<STR_LIT>" % docid)<EOL><DEDENT>self.fresh_docs[docid] = doc<EOL><DEDENT>self.fresh_docs.sync()<EOL>
Add a sequence of documents to be processed (indexed or trained on).

Here, the documents are simply collected; real processing is done later,
during the `self.index` or `self.train` calls.

`buffer` can be called repeatedly; the result is the same as if it was
called once, with a concatenation of all the partial document batches.
The point is to save memory when sending large corpora over network: the
entire `documents` must be serialized into RAM. See `utils.upload_chunked()`.

A call to `flush()` clears this documents-to-be-processed buffer (`flush`
is also implicitly called when you call `index()` and `train()`).