MCPcopy Create free account
hub / github.com/Dizzy-K/AutoPT / _match_benchmark_name

Function _match_benchmark_name

analysis/loader.py:307–325  ·  view source on GitHub ↗
(
    benchmark_tokens: Sequence[str],
    benchmark_index: dict[str, dict[str, Any]],
)

Source from the content-addressed store, hash-verified

305
306
307def _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
328def _benchmark_name_from_tokens(tokens: Sequence[str]) -> str:

Callers 1

_infer_legacy_metadataFunction · 0.85

Calls 1

_benchmark_lookup_keyFunction · 0.85

Tested by

no test coverage detected