js代码改写py

This commit is contained in:
fengche
2026-01-30 17:47:21 +08:00
parent a482e4ea77
commit aad77378ab
20 changed files with 2649 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
def compute_weights(lst):
total_hashrate = sum(user["mhs24h"] for user in lst)
users_weight = [
{
"user": user["user"],
"mhs24h": user["mhs24h"],
"weight": user["mhs24h"] / total_hashrate
}
for user in lst
]
return users_weight