1aee114cd0628f77b512e44b8dffc8ee6634291e,scipy/misc/pilutil.py,,bytescale,#Any#Any#Any#Any#Any#,29
Before Change
high = high - low
if cmin is None: cmin = data.min()
if cmax is None: cmax = data.max()
scale = high *1.0 / (cmax-cmin or 1)
bytedata = ((data*1.0-cmin)*scale + 0.4999).astype(uint8)
return bytedata + cast[uint8](low)
def imread(name,flatten=0):
After Change
cscale = cmax - cmin
if cscale < 0:
raise ValueError("`cmax` should be larger than `cmin`.")
elif cscale == 0:
cscale = 1
scale = float(high - low) / cscale
bytedata = (data * 1.0 - cmin) * scale + 0.4999
bytedata[bytedata > high] = high
bytedata[bytedata < 0] = 0
return cast[uint8](bytedata) + cast[uint8](low)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: scipy/scipy
Commit Name: 1aee114cd0628f77b512e44b8dffc8ee6634291e
Time: 2012-10-30
Author: ralf.gommers@googlemail.com
File Name: scipy/misc/pilutil.py
Class Name:
Method Name: bytescale
Project Name: deepmipt/DeepPavlov
Commit Name: c672738b39c8f739551da0d88991a2fedfba3e14
Time: 2018-10-04
Author: puleon@mail.ru
File Name: deeppavlov/models/ranking/metrics.py
Class Name:
Method Name: recall_at_k
Project Name: deepmipt/DeepPavlov
Commit Name: c672738b39c8f739551da0d88991a2fedfba3e14
Time: 2018-10-04
Author: puleon@mail.ru
File Name: deeppavlov/models/ranking/metrics.py
Class Name:
Method Name: rank_response