1d275bddd7349b765db88c76ec7dcfdf85de0f42,aletheialib/attacks.py,,difference,#Any#Any#,132

Before Change


    counts = {}
    for g in groups(I, mask):
        flip = (g + cmask) ^ abs_mask - cmask
        result = np.sign(smoothness(flip) - smoothness(g))
        if result not in counts:
            counts[result] = 0
        counts[result] += 1
    N = sum(counts.values())
    R = float(counts[1])/N
    S = float(counts[-1])/N
    return R-S

After Change


// {{{ difference()
def difference(I, mask):
    pool = Pool(multiprocessing.cpu_count())
    analysis = pool.map(RSAnalysis(mask).call, groups(I, mask))
    pool.close()
    pool.join()

    counts = [0, 0, 0]
    for v in analysis:
        counts[v] += 1

    N = sum(counts)
    R = float(counts[1])/N
    S = float(counts[-1])/N
    return R-S
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: daniellerch/aletheia
Commit Name: 1d275bddd7349b765db88c76ec7dcfdf85de0f42
Time: 2020-11-07
Author: kevin.clark@gmail.com
File Name: aletheialib/attacks.py
Class Name:
Method Name: difference


Project Name: lmcinnes/umap
Commit Name: 187a25566a4aeec255f8b3a52c065cb1be75294f
Time: 2019-02-13
Author: leland.mcinnes@gmail.com
File Name: umap/distances.py
Class Name:
Method Name: weighted_minkowski_grad


Project Name: lmcinnes/umap
Commit Name: 1d731829b41988ab47d8d5f3f4616a48a7dcf58a
Time: 2019-02-13
Author: leland.mcinnes@gmail.com
File Name: umap/distances.py
Class Name:
Method Name: minkowski_grad