← Lesson
Quarantine Flaky Rows
Joeven
Run
Reset
Python loads on first run
def score(rows): active = [r for r in rows if not r.get("quarantine")] if not active: return 0.0 return sum(1 for r in active if r["pass"]) / len(active) rows = [ {"id": "a", "pass": False, "quarantine": False}, {"id": "b", "pass": True, "quarantine": False}, {"id": "c", "pass": False, "quarantine": True}, ] print(score(rows)) print("active", [r["id"] for r in rows if not r["quarantine"]])
Run to execute this in your browser. Nothing is sent to a server.