# Author: Sandeep Belgavi. Synthetic exercise; no network or provider calls. cases=[(0.95,True),(0.80,False),(0.70,True),(0.55,False)] def evaluate(threshold): routed=[ok for score,ok in cases if score>=threshold] wrong=sum(not ok for ok in routed) return len(routed)/len(cases),wrong*10+len(cases)-len(routed) assert evaluate(0.65)==(0.75,11) assert evaluate(0.90)==(0.25,3) print("threshold 0.90 costs 3 units; threshold 0.65 costs 11 units")