8859c20eb97e803f66487c74615350b955efab4a,scripts/word_embeddings/utils.py,,prune_sentences,#Any#Any#,61

Before Change


    Downsample frequent words.
    pruned = []
    for idx in coded:
        if np.random.uniform(0.0, 1.0) < idx_to_pdiscard[idx]:
            pruned.append(idx)
    return pruned

After Change


@numba_njit
def prune_sentences(coded, idx_to_pdiscard):
    Downsample frequent words.
    return [t for t in coded if random.uniform(0, 1) > idx_to_pdiscard[t]]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: dmlc/gluon-nlp
Commit Name: 8859c20eb97e803f66487c74615350b955efab4a
Time: 2018-06-30
Author: leonard@lausen.nl
File Name: scripts/word_embeddings/utils.py
Class Name:
Method Name: prune_sentences


Project Name: rlworkgroup/garage
Commit Name: a3b6eae5e3c53fbd06298a9154de008b5d6ec778
Time: 2019-12-09
Author: ahtsans@gmail.com
File Name: tests/fixtures/policies/dummy_recurrent_policy.py
Class Name: DummyRecurrentPolicy
Method Name: get_param_values


Project Name: rlworkgroup/garage
Commit Name: 93b1a48d64e5f6712a14873c14831b875308a5da
Time: 2019-11-01
Author: ahtsans@gmail.com
File Name: tests/fixtures/policies/dummy_policy.py
Class Name: DummyPolicy
Method Name: get_param_values