<s> __author__ = '<STR_LIT>' <EOL> class Singleton ( type ) : <EOL> def __init__ ( cls , name , bases , d ) : <EOL> super ( Singleton , cls ) . __init__ ( name , bases , d ) <EOL> cls . instance = None <EOL> def __call__ ( cls , * args ) : <EOL> if cls . instance is None : <EOL> cls . instance = super ( Singleton , cls ) . __call__ ( * args ) <EOL> return cls . instance </s>
