da735616b83af99dc3a16edee3055527e379d93d,mathics/builtin/image.py,RandomImage,apply,#RandomImage#Any#Any#Any#Any#Any#,234
Before Change
def apply(self, minval, maxval, w, h, evaluation):
"RandomImage[{minval_?RealNumberQ, maxval_?RealNumberQ}, {w_Integer, h_Integer}]"
try:
x0 = max(minval.to_python(), 0)
x1 = min(maxval.to_python(), 1)
return Image((numpy.random.rand(h.to_python(), w.to_python()) * (x1 - x0) + x0), "Grayscale")
except:
import sys
return String(repr(sys.exc_info()))
// simple image manipulation
class ImageResize(Builtin):
options = {
"Resampling": ""Bicubic""
}
After Change
return evaluation.message("RandomImage", "bddim", from_python(size))
minrange, maxrange = minval.get_real_value(), maxval.get_real_value()
data = numpy.random.rand(size[1], size[0]) * (maxrange - minrange) + minrange
return Image(data, "Grayscale")
// simple image manipulation
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 4
Instances
Project Name: mathics/Mathics
Commit Name: da735616b83af99dc3a16edee3055527e379d93d
Time: 2016-08-16
Author: 16sn6uv@gmail.com
File Name: mathics/builtin/image.py
Class Name: RandomImage
Method Name: apply
Project Name: eth-cscs/reframe
Commit Name: 24b605e8ec48b9b67e507ca959eaed4ff4afc6a6
Time: 2018-02-14
Author: karakasis@cscs.ch
File Name: reframe/frontend/executors/policies.py
Class Name: AsynchronousExecutionPolicy
Method Name: run_check
Project Name: mathics/Mathics
Commit Name: 7a629259a1c42ee25eae800f1968418b05d503ba
Time: 2016-08-16
Author: Bernhard.Liebl@gmx.org
File Name: mathics/builtin/image.py
Class Name: ImageAdjust
Method Name: apply_auto
Project Name: openai/gym
Commit Name: eb7e4c87356714848b3ce97c08a557567b1da991
Time: 2016-04-28
Author: mail@jonasschneider.com
File Name: gym/envs/registration.py
Class Name:
Method Name: load