MCPcopy Create free account
hub / github.com/tox-dev/filelock / _percentile

Function _percentile

tasks/benchmark.py:199–202  ·  view source on GitHub ↗
(values: list[float], percentile: int)

Source from the content-addressed store, hash-verified

197
198
199def _percentile(values: list[float], percentile: int) -> float:
200 ordered = sorted(values)
201 index = min(len(ordered) - 1, round(percentile / 100 * len(ordered)))
202 return ordered[index]
203
204
205def _open_descriptors() -> int:

Callers 2

_cancellation_latencyFunction · 0.85
_timedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected