MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / clamp

Function clamp

experiments/baselines/citation_enhanced/runner.py:78–79  ·  view source on GitHub ↗
(value: float, lower: float = 0.0, upper: float = 1.0)

Source from the content-addressed store, hash-verified

76
77
78def clamp(value: float, lower: float = 0.0, upper: float = 1.0) -> float:
79 return max(lower, min(upper, value))
80
81
82def safe_float(value: Any, default: float = 0.0) -> float:

Callers 5

impact_scoreFunction · 0.70
scaled_similarityFunction · 0.70
content_scoreFunction · 0.70
citation_relation_scoreFunction · 0.70
score_rowFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected