result = []
for _ in range(sample_size):
    target = random.uniform(0, total)
current_total = 0
for index, (x, p) in enumerate(xps):
    current_total += p
if current_total > target:
    xps.pop(index)
result.append(x)
total -= p
break
return result
библиотека начальной загрузки статистики в Python?