(self, fname=None, version=-1)
return result
Saves the graph in Python pickled format, compressed with
        gzip.

        Saving in this format is a bit slower than saving in a Python pickle
        without compression, but the final file takes up much less space on
        the hard drive.

        @param fname: the name of the file or a stream to save to.
        @param version: pickle protocol version to be used. If -1, uses
          the highest protocol available
        @return: C{None} if the graph was saved successfully to the
          given file.
Saves the graph in Python pickled format, compressed with
        gzip.
Saves the graph in Python pickled format compressed with gzip .
def write_picklez(self, fname=None, version=-1):
        """Saves the graph in Python pickled format, compressed with
        gzip.

        Saving in this format is a bit slower than saving in a Python pickle
        without compression, but the final file takes up much less space on
        the hard drive.

        @param fname: the name of the file or a stream to save to.
        @param version: pickle protocol version to be used. If -1, uses
          the highest protocol available
        @return: C{None} if the graph was saved successfully to the
          given file.
        """
        import pickle as pickle

        file_was_opened = False

        if not hasattr(fname, "write"):
            file_was_opened = True
            fname = gzip.open(fname, "wb")
        elif not isinstance(fname, gzip.GzipFile):
            file_was_opened = True
            fname = gzip.GzipFile(mode="wb", fileobj=fname)

        result = pickle.dump(self, fname, version)

        if file_was_opened:
            fname.close()

        return result
def write_picklez ( self , fname = None , version = - 1 ) : import pickle as pickle file_was_opened = False if not hasattr ( fname , "write" ) : file_was_opened = True fname = gzip . open ( fname , "wb" ) elif not isinstance ( fname , gzip . GzipFile ) : file_was_opened = True fname = gzip . GzipFile ( mode = "wb" , fileobj = fname ) result = pickle . dump ( self , fname , version ) if file_was_opened : fname . close ( ) return result