2ee7ee03dd71cf59f7977beb0ed53738e2ac8349,pyimgaug/parameters.py,DiscreteUniform,__init__,#DiscreteUniform#Any#Any#,50
Before Change
class DiscreteUniform(StochasticParameter):
def __init__(self, a, b=None):
if isinstance(a, DiscreteUniform):
self.a = a.a
self.b = a.b
elif isinstance(a, int):
assert b is not None and isinstance(b, int)
assert a <= b
self.a = a
self.b = b
else:
raise Exception("Expected two int values or DiscreteUniform object, got %s, %s." % (type(a), type(b)))
def _draw_samples(self, size, random_state):
return random_state.randint(self.a, self.b, size)
def __repr__(self):
After Change
else:
self.a = a
if isinstance(b, int):
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: 7
Instances
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: slanglab/phrasemachine
Commit Name: d50b78e110cb41f5016478e996ef43e70b06f027
Time: 2016-09-30
Author: brenocon@gmail.com
File Name: py/phrasemachine.py
Class Name:
Method Name: get_phrases
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__