Returns random values for all of the parameters.
344176
def rvs(self, size=1, **kwargs):
        
        size = int(size)
        dtype = [(p, float) for p in self.params]
        arr = numpy.zeros(size, dtype=dtype)
        remaining = size
        keepidx = 0
        while remaining:
            draws = self._draw(size=remaining, **kwargs)
            mask = self._constraints(draws)
            addpts = mask.sum()
            arr[keepidx:keepidx+addpts] = draws[mask]
            keepidx += addpts
            remaining = size - keepidx
        return arr
231497
def _make_parameters(self):
        """"""
        self.value_means = []
        self.value_ranges = []
        self.arrangement = []
        self.variable_parameters = []
        current_var = 0
        for parameter in self.parameters:
            if parameter.type == ParameterType.DYNAMIC:
                self.value_means.append(parameter.value[0])
                if parameter.value[1] < 0:
                    raise AttributeError(
                        '"{}" parameter has an invalid range. Range values '
                        'must be greater than zero'.format(parameter.label))
                self.value_ranges.append(parameter.value[1])
                var_label = 'var{}'.format(current_var)
                self.arrangement.append(var_label)
                self.variable_parameters.append(var_label)
                current_var += 1
            elif parameter.type == ParameterType.STATIC:
                self.arrangement.append(parameter.value)
            else:
                raise AttributeError(
                    '"{}"Unknown parameter type ({}). Parameters can be STATIC or'
                    ' DYNAMIC.'.format(parameter.type))
        return
287566
@Override
    public String getRandomValue() {
        StringBuilder buf = new StringBuilder();
        while (buf.length() < expectedSizeOfRandomValues) {
            int index = getIndexIntoWordArray();
            buf.append(words[index]);
            buf.append(" ");
        }

        return buf.toString().substring(0, expectedSizeOfRandomValues);
    }
968007
public java.util.List<ParameterValue> getParameterValues() {
        if (parameterValues == null) {
            parameterValues = new com.amazonaws.internal.SdkInternalList<ParameterValue>();
        }
        return parameterValues;
    }
556655
def select(self, **kws):
        '''
            
        '''
        lst = [i for i in self.values() if i.select(**kws)]

        random.shuffle(lst)

        return lst
752706
def generateImplicitParameters(obj):
        
        if not hasattr(obj, 'uid'):
            rand = int(random.random() * 100000)
            now = datetime.datetime.now(utc)
            now = dateTimeToString(now)
            host = socket.gethostname()
            obj.add(ContentLine('UID', [], "{0} - {1}@{2}".format(now, rand,
                                                                  host)))
203856
public static <T> T pickRandom (Collection<T> values, Random r)
    {
        return pickRandom(values.iterator(), values.size(), r);
    }
943201
def Random(self):
        
        if len(self.d) == 0:
            raise ValueError('Pmf contains no values.')

        target = random.random()
        total = 0.0
        for x, p in self.d.iteritems():
            total += p
            if total >= target:
                return x

        # we shouldn't get here
        assert False
952424
private int randomWithRankedValues(IntVar x) {
        TIntArrayList[] values = new TIntArrayList[ranks.length];

        DisposableValueIterator ite = x.getValueIterator(true);
        try {
            while (ite.hasNext()) {
                int v = ite.next();
                int i;

                for (i = 0; i < ranks.length; i++) {
                    if (ranks[i].contains(v)) {
                        if (values[i] == null) {
                            values[i] = new TIntArrayList();
                        }
                        values[i].add(v);
                    }
                }
            }
        } finally {
            ite.dispose();
        }

        //We pick a random value in the first rank that is not empty (aka null here)
        for (TIntArrayList rank : values) {
            if (rank != null) {
                int v = rnd.nextInt(rank.size());
                return rank.get(v);
            }
        }
        return -1;
    }
404905
def generate_random_type(valid):
    
    type = choice(['int', 'str'])

    r = lambda: randrange(-1000000000, 1000000000)

    if type == 'int':
        return int,  (r() if valid else str(r()) for i in itertools.count())
    elif type == 'str':
        return str, (str(r()) if valid else r() for i in itertools.count())
    else:
        raise AssertionError('!')
813623
public T[] generateRandomCandidate(Random rng)
    {
        T[] candidate = elements.clone();
        List<T> list = Arrays.asList(candidate);
        Collections.shuffle(list, rng);
        return list.toArray(candidate);
    }
826944
def parameter_values(self):
        
        for param in self.data.get('parameter_values', []):
            cache = ElementCache(data=self.make_request(href=param))
            name = '{}'.format(cache.type.title()).replace('_', '')
            yield type(name, (SituationParameterValue,), {
                'data': cache})(name=cache.name, type=cache.type, href=param)
1261596
def sampling_params(self):
        
        if self.sampling_transforms is None:
            sampling_params = self.variable_params
        else:
            sampling_params = self.sampling_transforms.sampling_params
        return sampling_params
581628
def get_random(self):
        
        available = list(self.unchecked | self.good)
        if not available:
            return None
        return random.choice(available)
413706
function() {
    var block = this.rng.random() * this.discreteValues << 0
    return pad( block.toString( this.base ), this.fill, this.blockSize )
  }
252687
def randval(self):
        """"""
        fmtt = self.fmt[-1]
        if fmtt in "BHIQ":
            return {"B":RandByte,"H":RandShort,"I":RandInt, "Q":RandLong}[fmtt]()
        elif fmtt == "s":
            if self.fmt[0] in "0123456789":
                l = int(self.fmt[:-1])
            else:
                l = int(self.fmt[1:-1])
            return RandBin(l)
        else:
            warning("no random class for [%s] (fmt=%s)." % (self.name, self.fmt))
1343334
private RandomVariableInterface[] getBasisFunctions(RandomVariableInterface underlying) {
		double min = underlying.getMin();
		double max = underlying.getMax();

		ArrayList<RandomVariableInterface> basisFunctionList = new ArrayList<RandomVariableInterface>();
		double[] discretization = (new TimeDiscretization(min, numberOfBins, (max-min)/numberOfBins)).getAsDoubleArray();
		for(double discretizationStep : discretization) {
			RandomVariableInterface indicator = underlying.barrier(underlying.sub(discretizationStep), new RandomVariable(1.0), 0.0);
			basisFunctionList.add(indicator);
		}

		return basisFunctionList.toArray(new RandomVariableInterface[0]);
	}