MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / _normalize_inverse

Function _normalize_inverse

uncommon_route/router/selector.py:657–667  ·  view source on GitHub ↗
(values: dict[str, float])

Source from the content-addressed store, hash-verified

655
656
657def _normalize_inverse(values: dict[str, float]) -> dict[str, float]:
658 if not values:
659 return {}
660 minimum = min(values.values())
661 maximum = max(values.values())
662 if maximum <= minimum:
663 return {key: 0.5 for key in values}
664 return {
665 key: 1.0 - ((value - minimum) / (maximum - minimum))
666 for key, value in values.items()
667 }
668
669
670def _tier_complexity_anchor(tier: Tier) -> float:

Callers 1

_score_candidatesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected