This alert check is backwards: it fires when the error rate is below the threshold. You alert when errors exceed the threshold. Fix line 3 so a 10% error rate against a 5% threshold alerts (True).
Expected output:
True
The break is on line 3 — but read the whole snippet first.