<s> import logging <EOL> l = logging . getLogger ( "<STR_LIT>" ) <EOL> def once ( f ) : <EOL> name = f . __name__ <EOL> def func ( self , * args , ** kwargs ) : <EOL> if len ( args ) + len ( kwargs ) == <NUM_LIT:0> : <EOL> if hasattr ( self , "<STR_LIT:_>" + name ) : <EOL> return getattr ( self , "<STR_LIT:_>" + name ) <EOL> a = f ( self , * args , ** kwargs ) <EOL> setattr ( self , "<STR_LIT:_>" + name , a ) <EOL> return a <EOL> else : <EOL> return f ( self , * args , ** kwargs ) <EOL> func . __name__ = f . __name__ <EOL> return func </s>
