Sample k items without replacement from a stream where each item has a weight, in one pass (the A-Res algorithm of Efraimidis & Spirakis):
for each item with weight , draw and give it the key ; keep the k items with the largest keys.
Implement weighted_sample(stream, k, seed=0) where stream yields (item, weight) pairs with positive weights. Draw one rng.random() per item, in order, from np.random.default_rng(seed), and return the kept items sorted by key, largest first. Use a min-heap of size k.