#NEWLINE# def save( self , filename ) : #NEWLINE# #INDENT# 'Save the state of this network to a pickle file on disk.\n\n        Parameters\n        ----------\n        filename : str\n            Save the state of this network to a pickle file at the named path.\n            If this name ends in ".gz" then the output will automatically be\n            gzipped; otherwise the output will be a "raw" pickle.\n        ' #NEWLINE# opener = ( gzip . open if filename . lower ( ) . endswith ( '.gz' ) else open ) #NEWLINE# handle = opener ( filename , 'wb' ) #NEWLINE# pickle . dump ( self , handle , ( - 1 ) ) #NEWLINE# handle . close ( ) #NEWLINE# logging . info ( '%s: saved model' , filename )