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

Function clamp

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

Source from the content-addressed store, hash-verified

56
57
58def clamp(value: float, lower: float = 0.0, upper: float = 1.0) -> float:
59 return max(lower, min(upper, value))
60
61
62def safe_float(value: Any, default: float = 0.0) -> float:

Callers 4

scaled_similarityFunction · 0.70
phrase_alignment_scoreFunction · 0.70
aspect_coverage_scoreFunction · 0.70
score_rowFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected