2ee7ee03dd71cf59f7977beb0ed53738e2ac8349,pyimgaug/parameters.py,Uniform,__init__,#Uniform#Any#Any#,94
Before Change
class Uniform(StochasticParameter):
def __init__(self, a, b=None):
if isinstance(a, Uniform):
self.a = a.a
self.b = a.b
elif isinstance(a, (float, int)):
assert b is not None and isinstance(b, (float, int))
assert a <= b
self.a = a
self.b = b
else:
raise Exception("Expected two float/int values or Uniform object, got %s, %s." % (type(a), type(b)))
def _draw_samples(self, size, random_state):
return random_state.uniform(self.a, self.b, size)
def __repr__(self):
After Change
else:
self.a = a
if isinstance(b, (int, float)):
self.b = Deterministic(b)
else:
self.b = b
def _draw_samples(self, size, random_state):
a = self.a.draw_sample(random_state=random_state)
b = self.b.draw_sample(random_state=random_state)
if a > b:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: aleju/imgaug
Commit Name: 2ee7ee03dd71cf59f7977beb0ed53738e2ac8349
Time: 2016-11-10
Author: kontakt@ajung.name
File Name: pyimgaug/parameters.py
Class Name: Uniform
Method Name: __init__
Project Name: aleju/imgaug
Commit Name: 2ee7ee03dd71cf59f7977beb0ed53738e2ac8349
Time: 2016-11-10
Author: kontakt@ajung.name
File Name: pyimgaug/parameters.py
Class Name: DiscreteUniform
Method Name: __init__
Project Name: pymc-devs/pymc3
Commit Name: 2f5075be900731232fa6b4bd5a4990b143307df2
Time: 2017-04-18
Author: ColCarroll@users.noreply.github.com
File Name: pymc3/tests/test_step.py
Class Name: TestStepMethods
Method Name: check_trace