#NEWLINE# @ staticmethod #NEWLINE# def save_corpus( fname , corpus , id2word = None , progress_cnt = 1000 , metadata = False ) : #NEWLINE# #INDENT# "\n        Save a corpus in the Matrix Market format to disk.\n\n        This function is automatically called by `MmCorpus.serialize`; don't\n        call it directly, call `serialize` instead.\n        " #NEWLINE# logger . info ( ( 'storing corpus in Matrix Market format to %s' % fname ) ) #NEWLINE# num_terms = ( len ( id2word ) if ( id2word is not None ) else None ) #NEWLINE# return matutils . MmWriter . write_corpus ( fname , corpus , num_terms = num_terms , index = True , progress_cnt = num_terms , metadata = metadata )