code: def weighted_sample_with_replacement(seq, weights, n):
      
      sample = weighted_sampler(seq, weights)
      return [sample() for s in range(n)]
docs: Pick n samples from seq at random, with replacement, with the
      probability of each element in proportion to its corresponding
      weight.