<s> import IECore <EOL> import Gaffer <EOL> import GafferDispatch <EOL> class TaskContextProcessor ( GafferDispatch . ExecutableNode ) : <EOL> def __init__ ( self , name = "<STR_LIT>" ) : <EOL> GafferDispatch . ExecutableNode . __init__ ( self , name ) <EOL> def preTasks ( self , context ) : <EOL> contexts = self . _processedContexts ( context ) <EOL> result = [ ] <EOL> for plug in self [ "<STR_LIT>" ] : <EOL> source = plug . source ( ) <EOL> if source . isSame ( plug ) : <EOL> continue <EOL> if not isinstance ( source . node ( ) , GafferDispatch . ExecutableNode ) : <EOL> continue <EOL> result . extend ( [ self . Task ( source . node ( ) , c ) for c in contexts ] ) <EOL> return result <EOL> def hash ( self , context ) : <EOL> return IECore . MurmurHash ( ) <EOL> def execute ( self ) : <EOL> pass <EOL> def _processedContexts ( self , context ) : <EOL> raise NotImplementedError <EOL> IECore . registerRunTimeTyped ( TaskContextProcessor , typeName = "<STR_LIT>" ) </s>
