a3400845afb88d0d9b19f7f810abbd718117f24e,src/fonduer/utils/utils_udf.py,,get_sparse_matrix,#Any#Any#Any#Any#,102

Before Change


    if key:
        keys_map = {key: 0}
    else:
        keys_map = {
            key.name: idx
            for (idx, key) in enumerate(get_sparse_matrix_keys(session, key_table))
        }

    for cand_list in cand_lists:
        indptr = [0]
        indices = []

After Change


    cand_lists = cand_lists if isinstance(cand_lists, (list, tuple)) else [cand_lists]

    for cand_list in cand_lists:
        if len(cand_list) == 0:
            raise ValueError("cand_lists contain empty cand_list.")
        candidate_class = cand_list[0].__tablename__

        // Keys are used as a global index
        if key:
            keys_map = {key: 0}
            key_size = len(keys_map)
        else:
            all_keys = get_sparse_matrix_keys(session, key_table)
            key_size = len(all_keys)
            keys_map = {}
            for (i, k) in enumerate(all_keys):
                if candidate_class in k.candidate_classes:
                    keys_map[k.name] = i

        indptr = [0]
        indices = []
        data = []
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: HazyResearch/fonduer
Commit Name: a3400845afb88d0d9b19f7f810abbd718117f24e
Time: 2018-10-17
Author: lukehsiao@users.noreply.github.com
File Name: src/fonduer/utils/utils_udf.py
Class Name:
Method Name: get_sparse_matrix


Project Name: deepgram/kur
Commit Name: bc6c691202e5f8755de7b13d88f86286ff878abb
Time: 2017-05-10
Author: ajsyp@syptech.net
File Name: kur/backend/keras_backend.py
Class Name: KerasBackend
Method Name: process_loss


Project Name: deepgram/kur
Commit Name: bc6c691202e5f8755de7b13d88f86286ff878abb
Time: 2017-05-10
Author: ajsyp@syptech.net
File Name: kur/backend/pytorch_backend.py
Class Name: PyTorchBackend
Method Name: process_loss