30b28d8859d4a5f8ae94b59503ba90e04317cec9,rankeval/dataset/dataset.py,Dataset,__hash__,#Dataset#,311

Before Change


        return self.name

    def __hash__(self):
        return int( self.y[:100].sum() + self.X[:100,0].sum() )

    def __eq__(self, other):
        // use != instead of == because it is more efficient for sparse matrices:
        x_eq = not(self.X != other.X).any()

After Change



    def __hash__(self):

        h = hashlib.md5()

        for arr in [self.X, self.y, self.query_ids]:
            h.update(arr)

        return int(h.hexdigest(), 16)

    def __eq__(self, other):
        // use != instead of == because it is more efficient for sparse matrices:
        x_eq = not(self.X != other.X).any()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: hpclab/rankeval
Commit Name: 30b28d8859d4a5f8ae94b59503ba90e04317cec9
Time: 2019-07-22
Author: trani.salvatore@gmail.com
File Name: rankeval/dataset/dataset.py
Class Name: Dataset
Method Name: __hash__


Project Name: PPPLDeepLearning/plasma-python
Commit Name: db55cbceeb3d73d8fade33b16982833c795e331c
Time: 2017-12-26
Author: asvyatkovskiy@gmail.com
File Name: plasma/conf_parser.py
Class Name:
Method Name: get_unique_signal_hash


Project Name: PPPLDeepLearning/plasma-python
Commit Name: db55cbceeb3d73d8fade33b16982833c795e331c
Time: 2017-12-26
Author: asvyatkovskiy@gmail.com
File Name: plasma/primitives/data.py
Class Name: Signal
Method Name: __hash__