(
benchmark_tokens: Sequence[str],
benchmark_index: dict[str, dict[str, Any]],
)
| 305 | |
| 306 | |
| 307 | def _match_benchmark_name( |
| 308 | benchmark_tokens: Sequence[str], |
| 309 | benchmark_index: dict[str, dict[str, Any]], |
| 310 | ) -> str: |
| 311 | if not benchmark_tokens or not benchmark_index: |
| 312 | return "" |
| 313 | |
| 314 | joined = _benchmark_lookup_key("/".join(benchmark_tokens)) |
| 315 | best_name = "" |
| 316 | best_length = 0 |
| 317 | for key, metadata in benchmark_index.items(): |
| 318 | if not key: |
| 319 | continue |
| 320 | if key == joined or key in joined or joined in key: |
| 321 | name = str(metadata.get("name", "")) |
| 322 | if len(key) > best_length: |
| 323 | best_name = name |
| 324 | best_length = len(key) |
| 325 | return best_name |
| 326 | |
| 327 | |
| 328 | def _benchmark_name_from_tokens(tokens: Sequence[str]) -> str: |
no test coverage detected