<s> class MobsterConfigDict ( dict ) : <EOL> """<STR_LIT>""" <EOL> CONFIG_DEFAULTS = { <EOL> '<STR_LIT>' : <NUM_LIT> , <EOL> '<STR_LIT>' : False <EOL> } <EOL> _instance = None <EOL> def __new__ ( cls , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> if not cls . _instance : <EOL> cls . _instance = super ( MobsterConfigDict , cls ) . __new__ ( cls , * args , ** kwargs ) <EOL> return cls . _instance <EOL> else : <EOL> raise Exception ( "<STR_LIT>" "<STR_LIT>" ) <EOL> def __init__ ( self ) : <EOL> dict . __init__ ( self , MobsterConfigDict . CONFIG_DEFAULTS ) <EOL> def __setitem__ ( self , key , val ) : <EOL> """<STR_LIT>""" <EOL> if key not in MobsterConfigDict . CONFIG_DEFAULTS . keys ( ) : <EOL> raise KeyError ( '<STR_LIT>' . format ( key ) ) <EOL> return dict . __setitem__ ( self , key , val ) <EOL> config = MobsterConfigDict ( ) </s>
