if lower.size > 1 or upper.size > 1:
raise ValueError("Drawing samples from distributions with "
"array-valued bounds is not supported.")
samples = np.zeros(size, dtype=self.dtype).flatten()
i, n = 0, len(samples)
while i < len(samples):
sample = np.atleast_1d(self._wrapped.random(point=point, size=n))
select = sample[np.logical_and(sample >= lower, sample <= upper)]
samples[i:(i + len(select))] = select[:]
i += len(select)
n -= len(select)
if size is not None: