<s> class IndexFunctionCache ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , function , shape ) : <EOL> """<STR_LIT>""" <EOL> self . function = function <EOL> self . cache = np . empty ( shape , dtype = object ) <EOL> shape = property ( lambda self : self . cache . shape ) <EOL> def __call__ ( self , node ) : <EOL> """<STR_LIT>""" <EOL> node = tuple ( node ) <EOL> if self . cache [ node ] == None : <EOL> self . cache [ node ] = self . function ( node ) <EOL> return self . cache [ node ] </s>
