mirror of
https://github.com/dotnet/skills.git
synced 2026-09-20 09:49:54 +08:00
5a06b20cc9
* Support classic .NET test projects Teach dotnet-test skills and agents to preserve non-SDK projects, packages.config dependencies, explicit compile registration, legacy runners, and version-compatible MSTest APIs. Add regression evals for generation, execution, coverage, and authoring. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: fdfec89f-b610-479c-a6c7-c2936b300e68 * Address classic test fixture review Tighten the MSTest version grader, make the runner fixture assertion behavioral, and use nameof for the guarded parameter. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: fdfec89f-b610-479c-a6c7-c2936b300e68 --------- Copilot-Session: fdfec89f-b610-479c-a6c7-c2936b300e68
21 lines
609 B
Python
21 lines
609 B
Python
from __future__ import annotations
|
|
|
|
from typing import Sequence
|
|
|
|
|
|
def mean(values: Sequence[float]) -> float:
|
|
if not values:
|
|
raise ValueError("values must not be empty")
|
|
return sum(values) / len(values)
|
|
|
|
|
|
def percentile(values: Sequence[float], percentile_value: float) -> float:
|
|
if not values:
|
|
raise ValueError("values must not be empty")
|
|
if percentile_value < 0 or percentile_value > 100:
|
|
raise ValueError("percentile must be between 0 and 100")
|
|
|
|
ordered = sorted(values)
|
|
index = round((percentile_value / 100) * (len(ordered) - 1))
|
|
return ordered[index]
|