21678f424e8a7b0734e2dcc31d0a2ee2e10af097,snorkel/annotations.py,AnnotationManager,load,#AnnotationManager#,152

Before Change


        for cid, kid, val in q.all():
            if cid not in row_index:
                row_index[cid] = len(row_index)
            if kid not in col_index:
                col_index[kid] = len(col_index)
            X[row_index[cid], col_index[kid]] = val

        // Return as an AnnotationMatrix
        return self.matrix_cls(X, candidate_set=candidate_set, key_set=key_set)

After Change


        
        // Iteratively construct row index and output sparse matrix
        cid_to_row = {}
        row_to_cid = {}
        for cid, kid, val in q.all():
            if cid not in cid_to_row:
                i = len(cid_to_row)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: snorkel-team/snorkel
Commit Name: 21678f424e8a7b0734e2dcc31d0a2ee2e10af097
Time: 2016-09-04
Author: ajratner@gmail.com
File Name: snorkel/annotations.py
Class Name: AnnotationManager
Method Name: load


Project Name: acl-org/acl-anthology
Commit Name: 7419eacac2dfa909b280881524e685d7ea4d7ec7
Time: 2020-04-24
Author: post@cs.jhu.edu
File Name: bin/add_attachments.py
Class Name:
Method Name: add_attachment


Project Name: rtqichen/torchdiffeq
Commit Name: 625784c31f592f3b760b53faa0c2f31b57be238a
Time: 2020-07-30
Author: 33688385+patrick-kidger@users.noreply.github.com
File Name: torchdiffeq/_impl/misc.py
Class Name:
Method Name: _check_inputs