Review this Python circuit breaker. When open, after a cooldown it moves to half-open and lets calls through to test recovery.