function sample2( options ) {
		var replace;
		var mutate;
		var opts;
		var size;
		var err;
		var out;

		if ( pool.length === 0 ) {
			return null;
		}
		opts = {};
		if ( arguments.length ) {
			err = validate( opts, options );
			if ( err ) {
				throw err;
			}
		}
		if ( opts.mutate === void 0 ) {
			mutate = conf.mutate;
		} else {
			mutate = opts.mutate;
		}
		if ( opts.replace === void 0 ) {
			replace = conf.replace;
		} else {
			replace = opts.replace;
		}
		if ( opts.size ) {
			size = opts.size;
		} else if ( conf.size ) {
			size = conf.size;
		} else {
			size = pool.length;
		}
		if (
			replace === false &&
			size > pool.length
		) {
			throw new RangeError( format( 'invalid option. `size` option must be less than or equal to the population size when `replace` is `false`. Option: `%s`.', size ) );
		}
		if ( replace ) {
			return discreteUniform( pool, size, rand );
		}
		out = fisherYates( pool, size, rand );
		if ( mutate ) {
			// Remove the sample observations:
			pool = pool.slice( size, pool.length );
		}
		return out;
	}
Samples elements from a population.

@private
@param {Options} [options] - function options
@param {NonNegativeInteger} [options.size] - sample size
@param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement
@param {boolean} [options.mutate=false] - boolean indicating whether to mutate the `pool` when sampling without replacement
@throws {TypeError} options argument must be an object
@throws {TypeError} must provide valid options
@throws {RangeError} `size` option must be less than or equal to the population when the `replace` option is `false`
@returns {Array} sample