<s> from __future__ import absolute_import <EOL> import logging <EOL> import six <EOL> log = logging . getLogger ( __name__ ) <EOL> class CircuitBreakerMetaclass ( type ) : <EOL> __instances__ = dict ( ) <EOL> __blacklist__ = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def __new__ ( cls , name , bases , attrs ) : <EOL> if name in cls . __blacklist__ : <EOL> return super ( CircuitBreakerMetaclass , cls ) . __new__ ( cls , name , <EOL> bases , attrs ) <EOL> class_name = attrs . get ( '<STR_LIT>' , <EOL> '<STR_LIT>' . format ( name ) ) <EOL> new_class = super ( CircuitBreakerMetaclass , cls ) . __new__ ( cls , <EOL> class_name , <EOL> bases , attrs ) <EOL> setattr ( new_class , '<STR_LIT>' , class_name ) <EOL> if class_name not in cls . __instances__ : <EOL> cls . __instances__ [ class_name ] = new_class <EOL> return cls . __instances__ [ class_name ] <EOL> class CircuitBreaker ( six . with_metaclass ( CircuitBreakerMetaclass , object ) ) : <EOL> __circuit_breaker_name__ = None </s>
