<s> import IECore <EOL> import Gaffer <EOL> class CachingTestNode ( Gaffer . ComputeNode ) : <EOL> def __init__ ( self , name = "<STR_LIT>" ) : <EOL> Gaffer . ComputeNode . __init__ ( self , name ) <EOL> self . addChild ( Gaffer . StringPlug ( "<STR_LIT>" , Gaffer . Plug . Direction . In ) ) <EOL> self . addChild ( Gaffer . ObjectPlug ( "<STR_LIT>" , Gaffer . Plug . Direction . Out , IECore . NullObject ( ) ) ) <EOL> self . numHashCalls = <NUM_LIT:0> <EOL> def affects ( self , input ) : <EOL> outputs = Gaffer . ComputeNode . affects ( self , input ) <EOL> if input . isSame ( self [ "<STR_LIT>" ] ) : <EOL> outputs . append ( self [ "<STR_LIT>" ] ) <EOL> return outputs <EOL> def hash ( self , output , context , h ) : <EOL> assert ( output . isSame ( self [ "<STR_LIT>" ] ) ) <EOL> self [ "<STR_LIT>" ] . hash ( h ) <EOL> self . numHashCalls += <NUM_LIT:1> <EOL> def compute ( self , plug , context ) : <EOL> assert ( plug . isSame ( self [ "<STR_LIT>" ] ) ) <EOL> self [ "<STR_LIT>" ] . setValue ( IECore . StringData ( self [ "<STR_LIT>" ] . getValue ( ) ) ) <EOL> IECore . registerRunTimeTyped ( CachingTestNode , typeName = "<STR_LIT>" ) </s>
