Python implementation of the Circuit Breaker pattern.