1d275bddd7349b765db88c76ec7dcfdf85de0f42,aletheialib/attacks.py,,difference,#Any#Any#,132
Before Change
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
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
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 5
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: allenai/allennlp
Commit Name: 0459261c388bec72937e0268c4316b85279d0bac
Time: 2018-09-24
Author: kl2806@columbia.edu
File Name: allennlp/semparse/worlds/atis_world.py
Class Name: AtisWorld
Method Name: __init__
Project Name: deepfakes/faceswap
Commit Name: acc6553f80d17469bedfdcdab2ea676478a49d9d
Time: 2019-07-04
Author: 36920800+torzdf@users.noreply.github.com
File Name: tools/effmpeg.py
Class Name: Effmpeg
Method Name: get_fps
Project Name: openeventdata/mordecai
Commit Name: 580af77a96d8c6b306ad4425eafd7768df00338a
Time: 2018-06-27
Author: ahalterman0@gmail.com
File Name: mordecai/geoparse.py
Class Name: Geoparser
Method Name: geoparse
Project Name: nipy/dipy
Commit Name: 23a07e8601cbdba5ece453864bc6d11e3431543e
Time: 2019-07-23
Author: francois.m.rheault@usherbrooke
File Name: dipy/workflows/viz.py
Class Name: HorizonFlow
Method Name: run