class_docstr: Interface for corpus classes from :mod:`gensim.corpora`.
  
  Corpus is simply an iterable object, where each iteration step yields one document:
  
  .. sourcecode:: pycon
  
      >>> from gensim.corpora import MmCorpus  # inherits from the CorpusABC class
      >>> from gensim.test.utils import datapath
      >>>
      >>> corpus = MmCorpus(datapath("testcorpus.mm"))
      >>> for doc in corpus:
      ...     pass  # do something with the doc...
  
  A document represented in the bag-of-word (BoW) format, i.e. list of (attr_id, attr_value),
  like ``[(1, 0.2), (4, 0.6), ...]``.
  
  .. sourcecode:: pycon
  
      >>> from gensim.corpora import MmCorpus  # inherits from the CorpusABC class
      >>> from gensim.test.utils import datapath
      >>>
      >>> corpus = MmCorpus(datapath("testcorpus.mm"))
      >>> doc = next(iter(corpus))
      >>> print(doc)
      [(0, 1.0), (1, 1.0), (2, 1.0)]
  
  Remember that the save/load methods only pickle the corpus object, not
  the (streamed) corpus data itself!
  To save the corpus data, please use this pattern :
  
  .. sourcecode:: pycon
  
      >>> from gensim.corpora import MmCorpus  # MmCorpus inherits from CorpusABC
      >>> from gensim.test.utils import datapath, get_tmpfile
      >>>
      >>> corpus = MmCorpus(datapath("testcorpus.mm"))
      >>> tmp_path = get_tmpfile("temp_corpus.mm")
      >>>
      >>> MmCorpus.serialize(tmp_path, corpus)  # serialize corpus to disk in the MmCorpus format
      >>> loaded_corpus = MmCorpus(tmp_path)  # load corpus through constructor
      >>> for (doc_1, doc_2) in zip(corpus, loaded_corpus):
      ...     assert doc_1 == doc_2  # no change between the original and loaded corpus
  
  
  See Also
  --------
  :mod:`gensim.corpora`
      Corpora in different formats.
class_docstr_tok: ["Interface","for","corpus","classes","from",":","mod",":","`","gensim.corpora","`",".","Corpus","is","simply","an","iterable","object",",","where","each","iteration","step","yields","one","document",":","..","sourcecode",":",":","pycon",">",">",">","from","gensim.corpora","import","MmCorpus","#","inherits","from","the","CorpusABC","class",">",">",">","from","gensim.test.utils","import","datapath",">",">",">",">",">",">","corpus","=","MmCorpus","(","datapath","(","``","testcorpus.mm","''",")",")",">",">",">","for","doc","in","corpus",":","...","pass","#","do","something","with","the","doc","...","A","document","represented","in","the","bag-of-word","(","BoW",")","format",",","i.e",".","list","of","(","attr_id",",","attr_value",")",",","like","``","[","(","1",",","0.2",")",",","(","4",",","0.6",")",",","...","]","``",".","..","sourcecode",":",":","pycon",">",">",">","from","gensim.corpora","import","MmCorpus","#","inherits","from","the","CorpusABC","class",">",">",">","from","gensim.test.utils","import","datapath",">",">",">",">",">",">","corpus","=","MmCorpus","(","datapath","(","``","testcorpus.mm","''",")",")",">",">",">","doc","=","next","(","iter","(","corpus",")",")",">",">",">","print","(","doc",")","[","(","0",",","1.0",")",",","(","1",",","1.0",")",",","(","2",",","1.0",")","]","Remember","that","the","save\/load","methods","only","pickle","the","corpus","object",",","not","the","(","streamed",")","corpus","data","itself","!","To","save","the","corpus","data",",","please","use","this","pattern",":","..","sourcecode",":",":","pycon",">",">",">","from","gensim.corpora","import","MmCorpus","#","MmCorpus","inherits","from","CorpusABC",">",">",">","from","gensim.test.utils","import","datapath",",","get_tmpfile",">",">",">",">",">",">","corpus","=","MmCorpus","(","datapath","(","``","testcorpus.mm","''",")",")",">",">",">","tmp_path","=","get_tmpfile","(","``","temp_corpus.mm","''",")",">",">",">",">",">",">","MmCorpus.serialize","(","tmp_path",",","corpus",")","#","serialize","corpus","to","disk","in","the","MmCorpus","format",">",">",">","loaded_corpus","=","MmCorpus","(","tmp_path",")","#","load","corpus","through","constructor",">",">",">","for","(","doc_1",",","doc_2",")","in","zip","(","corpus",",","loaded_corpus",")",":","...","assert","doc_1","==","doc_2","#","no","change","between","the","original","and","loaded","corpus","See","Also","--","--","--","--",":","mod",":","`","gensim.corpora","`","Corpora","in","different","formats","."]
docstr: Saves the in-memory state of the corpus (pickles the object).
  
  Warnings
  --------
  This saves only the "internal state" of the corpus object, not the corpus data!
  
  To save the corpus data, use the `serialize` method of your desired output format
  instead, e.g. :meth:`gensim.corpora.mmcorpus.MmCorpus.serialize`.
docstr_tok: ["Saves","the","in-memory","state","of","the","corpus","(","pickles","the","object",")",".","Warnings","--","--","--","--","This","saves","only","the","``","internal","state","''","of","the","corpus","object",",","not","the","corpus","data","!","To","save","the","corpus","data",",","use","the","`","serialize","`","method","of","your","desired","output","format","instead",",","e.g",".",":","meth",":","`","gensim.corpora.mmcorpus.MmCorpus.serialize","`","."]
code: def save(self, *args, **kwargs):
      """Saves the in-memory state of the corpus (pickles the object).
  
      Warnings
      --------
      This saves only the "internal state" of the corpus object, not the corpus data!
  
      To save the corpus data, use the `serialize` method of your desired output format
      instead, e.g. :meth:`gensim.corpora.mmcorpus.MmCorpus.serialize`.
  
      """
      import warnings
  
      warnings.warn(
          "corpus.save() stores only the (tiny) iteration object in memory; "
          "to serialize the actual corpus content, use e.g. MmCorpus.serialize(corpus)"
      )
      super(CorpusABC, self).save(*args, **kwargs)
  
imports: import logging
  from gensim import utils, matutils
label_desc: Use image node_id 2 for calling the CorpusABC obj's underlying member method code with example usage: obj.save() without return types