🤖 自动格式化代码 [skip ci]

This commit is contained in:
github-actions[bot]
2025-07-11 05:19:35 +00:00
parent 5f0a0c0e3a
commit 1bff478fcc
12 changed files with 15 additions and 13 deletions

View File

@@ -974,7 +974,7 @@ def weighted_sample_no_replacement(items, weights, k) -> list:
2. 不会重复选中同一个元素
"""
selected = []
pool = list(zip(items, weights))
pool = list(zip(items, weights, strict=False))
for _ in range(min(k, len(pool))):
total = sum(w for _, w in pool)
r = random.uniform(0, total)