cd91a294f32206728436890be3e697b6c1325841,datasketch/minhash.py,MinHash,__getstate__,#MinHash#,125

Before Change



    // Implement the following 2 methods to make pickling happy in python 2
    def __getstate__(self):
        return dict([x, getattr(self, x)] for x in self.__slots__)

    def __setstate__(self, d):
        for key in d:
            setattr(self, key, d[key])

After Change


        Note that the bytes returned by the Python pickle.dumps is not
        the same as the buffer returned by this function.
        """
        buffer = bytearray(self.bytesize())
        self.serialize(buffer)
        return buffer

    def __setstate__(self, buffer):
        """
        This function is called when unpickling the MinHash object.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: ekzhu/datasketch
Commit Name: cd91a294f32206728436890be3e697b6c1325841
Time: 2015-04-08
Author: erkangzhu@gmail.com
File Name: datasketch/minhash.py
Class Name: MinHash
Method Name: __getstate__


Project Name: Theano/Theano
Commit Name: 28c3249d1440a5526946d274dfe41b7501c5a4af
Time: 2017-01-13
Author: r.askari.hemmat@gmail.com
File Name: theano/gpuarray/basic_ops.py
Class Name: GpuJoin
Method Name: __str__


Project Name: pantsbuild/pants
Commit Name: 6ef659e1f2b3301a069a8a06c91d5417efcac92f
Time: 2015-09-25
Author: john.sirois@gmail.com
File Name: src/python/pants/backend/jvm/targets/jar_dependency.py
Class Name: JarDependency
Method Name: cache_key