INNER CODE UNIT · Python
_clamped_explicit_score
LiuMengxuan04/shushu-internship-tool · skills/shushu-internship-tool/scripts/shushu_internship_tool/candidate_score.py:51
def _clamped_explicit_score(
candidate: dict[str, Any],
keys: tuple[str, ...],
*,
default: int,
minimum: int,
maximum: int,
) -> tuple[int, str | None]:
for key in keys:
if key in candidate and candidate[key] not in (None, ""):
value = int(round(safe_float(candidate[key], default)))
value = max(minimum, min(maximum, value))
return value, key
return default, None
def license_score(candidate: dict[str, Any]) -> tuple[int, str]:
points, source = _clamped_explicit_score(