MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / percentile

Function percentile

scripts/server/benchmark_sync_s3_latency.py:19–29  ·  view source on GitHub ↗
(values: List[float], p: float)

Source from the content-addressed store, hash-verified

17
18
19def percentile(values: List[float], p: float) -> float:
20 if not values:
21 return 0.0
22 if len(values) == 1:
23 return values[0]
24 sorted_values = sorted(values)
25 rank = (len(sorted_values) - 1) * p
26 low = int(rank)
27 high = min(low + 1, len(sorted_values) - 1)
28 weight = rank - low
29 return sorted_values[low] * (1 - weight) + sorted_values[high] * weight
30
31
32def build_s3_client(args: argparse.Namespace):

Callers 1

print_summaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected