Python cPickle 模块,html() 实例源码

我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用cPickle.html()

项目:django-corenlp    作者:arunchaganty    | 项目源码 | 文件源码
def dump(self, outfile):
        '''
        Serialize the model for this learner and write it to a file.
        Serialized models can be loaded back in with `load`.

        By default, pickle the entire object. This may not be very efficient
        or reliable for long-term storage; consider overriding this (and `load`)
        to serialize only the necessary parameters. Alternatively, you can
        define __getstate__ and __setstate__ for subclasses to influence how
        the model is pickled (see https://docs.python.org/2/library/pickle.html).

        :param file outfile: A file-like object where the serialized model will
            be written.
        '''
        pickle.dump(self, outfile)
项目:django-corenlp    作者:arunchaganty    | 项目源码 | 文件源码
def dump(self, outfile):
        '''
        Serialize the model for this learner and write it to a file.
        Serialized models can be loaded back in with `load`.

        By default, pickle the entire object. This may not be very efficient
        or reliable for long-term storage; consider overriding this (and `load`)
        to serialize only the necessary parameters. Alternatively, you can
        define __getstate__ and __setstate__ for subclasses to influence how
        the model is pickled (see https://docs.python.org/2/library/pickle.html).

        :param file outfile: A file-like object where the serialized model will
            be written.
        '''
        pickle.dump(self, outfile)