Gets a random option until all options have been returns. Then cycles again.
774098
function pick() {
                if (this._remainingOptions.length === 0) {
                  this._remainingOptions = clone(this._originalOptions);
                }

                var index = Math.floor(Math.random() * this._remainingOptions.length);
                return this._remainingOptions.splice(index, 1)[0];
              }
145357
function selectWithoutValidation(choices) {
	// Generate a list of options with positive non-zero chances
	let choicesWithNonZeroChances = [];
	let totalWeight = 0.0;
	for(let i = 0; i < choices.length; i++) {
		if(choices[i].chance > 0.0) {
			choicesWithNonZeroChances.push(choices[i]);
			totalWeight += choices[i].chance;
		}
	}

	// Pick a random value from [0,1)
	let value = Math.random() * totalWeight;

	// Iterate over possibilities until we find the selected one
	let chanceCovered = 0.0;
	for(let i = 0; i < choicesWithNonZeroChances.length; i++) {
		chanceCovered += choicesWithNonZeroChances[i].chance;
		if(value < chanceCovered) {
			return choicesWithNonZeroChances[i].result;
		}
	}
}
764062
def query_random(**kwargs):
        '''
        
        '''

        if 'limit' in kwargs:
            limit = kwargs['limit']
        elif 'num' in kwargs:
            limit = kwargs['num']
        else:
            limit = 10

        kind = kwargs.get('kind', None)

        if kind:
            rand_recs = TabPost.select().where(
                (TabPost.kind == kind) &
                (TabPost.valid == 1)
            ).order_by(
                peewee.fn.Random()
            ).limit(limit)
        else:
            rand_recs = TabPost.select().where(
                TabPost.valid == 1
            ).order_by(
                peewee.fn.Random()
            ).limit(limit)
        return rand_recs
556655
def select(self, **kws):
        '''
            
        '''
        lst = [i for i in self.values() if i.select(**kws)]

        random.shuffle(lst)

        return lst
1077425
public function rand(){
		if($this->validateConditions())
			return $this;

		$this->resetState();
		$this->connection->getDriver()->randomizeOrder($this);
		return $this;
	}
1023870
def simulate(self):
        """"""
        min_ = (-sys.maxsize - 1) if self._min is None else self._min
        max_ = sys.maxsize if self._max is None else self._max
        return random.randint(min_, max_)
274741
def random(self, *args, **kwargs):
        
        indexer = Random()
        self.add(indexer)

        return self
1195666
def random_leaf(self):
        ""
        for i in range(self._number_tries_feasible_ind):
            var = np.random.randint(self.nvar)
            v = self._random_leaf(var)
            if v is None:
                continue
            return v
        raise RuntimeError("Could not find a suitable random leaf")
121047
function option() {
    var ret = this.seq(
        this.stringf('['),
        this.manyf(c_wsp),
        alternation,
        this.manyf(c_wsp),
        this.stringf(']'));
    return new ast.Repetition(new ast.Repeat(0,1), ret[3]);
}
806479
def randomizeOrder(self):
        
        flag = [0] * len(self.inputs)
        self.loadOrder = [0] * len(self.inputs)
        for i in range(len(self.inputs)):
            pos = int(random.random() * len(self.inputs))
            while (flag[pos] == 1):
                pos = int(random.random() * len(self.inputs))
            flag[pos] = 1
            self.loadOrder[pos] = i
506655
def choose_one(things):
    """"""
    choice = SystemRandom().randint(0, len(things) - 1)
    return things[choice].strip()
1070290
public void randomWait(long min, long max) {
		final long waitTime = randomLong(min, max);
		try {
			Thread.sleep(waitTime);
		} catch (InterruptedException interruptedException) {
			// ignored
		}
	}
1311091
def get_random_value(length=10, character_sets=[string.ascii_uppercase, string.ascii_lowercase]):
        

        return "".join(random.choice("".join(character_sets)) for i in range(length))
1280539
function randstr(options) {
    var opt = _validateOptions(options);
    var from, to;
    if (Array.isArray(opt.length)) {
        _a = opt.length, from = _a[0], to = _a[1];
    }
    else {
        from = to = opt.length;
    }
    var str = '';
    if (0 === to) {
        return str;
    }
    var charsIsString = 'string' === typeof opt.chars;
    var charsLastIndex = charsIsString ? opt.chars.length - 1 : 0;
    var includeControlChars = true === opt.includeControlChars;
    var hasAcceptableFunc = 'function' === typeof opt.acceptable;
    var hasReplacer = 'function' === typeof opt.replacer;
    var max = _randomIntBetween(opt.random, from, to);
    // console.log( 'max', max, 'from', from, 'to', to );
    for (var i = 0, len = 0, charCode = void 0, chr = void 0; i < max && len < max; ++i) {
        if (charsIsString) {
            var index = _randomIntBetween(opt.random, 0, charsLastIndex);
            charCode = opt.chars.charCodeAt(index);
        }
        else {
            charCode = _randomIntBetween(opt.random, opt.chars[0], opt.chars[1]);
        }
        // Non printable?
        if (!includeControlChars && _isControlChar(charCode)) {
            // console.log( 'NOT PRINTABLE!');
            --i; // back to try again
            continue;
        }
        chr = String.fromCharCode(charCode);
        // console.log( 'charCode', charCode, 'char', chr );
        if (hasAcceptableFunc && !opt.acceptable.call(null, chr)) {
            --i; // back to try again
            continue;
        }
        if (hasReplacer) {
            chr = opt.replacer.call(null, chr);
            // console.log( 'char after', chr );
            // Their combined length pass the limit?
            if ((len + chr.length) > max) {
                // console.log( 'greater than max!', 'i', i, 'max', max, 'str', len, 'chr', chr.length );
                --i; // back to try again
                continue;
            }
        }
        str += chr;
        len = str.length;
    }
    return str;
    var _a;
}
470435
String getOption(String[] options, int index) {
        if ((options != null) && (options.length > index)) {
            return options[index];
        }
        return null;
    }
159596
def get_random(min_pt, max_pt):
        """"""
        result = Point(random.random(), random.random())
        return result.get_component_product(max_pt - min_pt) + min_pt
749715
function randomize_options( $options ) {
		$new  = array();
		$keys = array_keys( $options );
		shuffle( $keys );

		foreach ( $keys as $key ) {
			$new[ $key ] = $options[ $key ];
		}

		return $new;
	}