def replicated_dataset(dataset, weights, n=None):
n = n or len(dataset.examples)<EOL>result = copy.copy(dataset)<EOL>result.examples = weighted_replicate(dataset.examples, weights, n)<EOL>return result<EOL>
Copy dataset, replicating each example in proportion to its weight.