<s> """<STR_LIT>""" <EOL> import logging <EOL> import ctypes <EOL> import ufora . FORA . python . Runtime as Runtime <EOL> import ufora . native . FORA as ForaNative <EOL> import ufora . native . Hash as Hash <EOL> import ufora . BackendGateway . ComputedGraph . ComputedGraph as ComputedGraph <EOL> import ufora . core . math . StableHashFunction as StableHashFunction <EOL> import ufora . native . Cumulus as CumulusNative <EOL> import ufora . util . TypeAwareComparison as TypeAwareComparison <EOL> import ufora . BackendGateway . SubscribableWebObjects . Exceptions as Exceptions <EOL> import ufora . BackendGateway . SubscribableWebObjects . ObjectClassesToExpose . WriteToS3Task as WriteToS3Task <EOL> ImplValContainer_ = ForaNative . ImplValContainer <EOL> def hashImplValContainer ( ivc , unhashableObjectPolicy ) : <EOL> return "<STR_LIT>" + str ( ivc . hash ) <EOL> StableHashFunction . hashFunctionsByType [ ImplValContainer_ ] = hashImplValContainer <EOL> import ufora . BackendGateway . ComputedValue . ComputedValueGateway as ComputedValueGateway <EOL> def isComputedValue ( o ) : <EOL> return ComputedGraph . isLocation ( o ) and issubclass ( o . __location_class__ , ComputedValue ) <EOL> def validateIsVectorIVC ( ivc ) : <EOL> return ivc . isVector ( ) <EOL> MAX_BYTES_TO_RETURN_IN_JSON = <NUM_LIT> <EOL> class ComputedValueVector ( ComputedGraph . Location ) : <EOL> """<STR_LIT>""" <EOL> vectorImplVal = ComputedGraph . Key ( object , default = None , validator = validateIsVectorIVC ) <EOL> @ ComputedGraph . Function <EOL> def __getitem__ ( self , index ) : <EOL> """<STR_LIT>""" <EOL> if self . vectorImplVal is None : <EOL> raise IndexError ( ) <EOL> if isinstance ( index , slice ) : <EOL> return ComputedValue ( <EOL> args = ( <EOL> self . vectorImplVal , <EOL> ForaNative . makeSymbol ( "<STR_LIT>" ) , <EOL> ForaNative . ImplValContainer ( index . start ) , <EOL> ForaNative . ImplValContainer ( index . stop ) , <EOL> ForaNative . ImplValContainer ( index . step ) <EOL> ) <EOL> ) <EOL> if index < <NUM_LIT:0> or index >= self . elementCount : <EOL> raise IndexError ( ) <EOL> return self . entireSlice . extractVectorItemAsIVC ( index ) <EOL> @ ComputedGraph . ExposedProperty ( ) <EOL> def elementCount ( self ) : <EOL> if self . vectorImplVal is None : <EOL> return <NUM_LIT:0> <EOL> return self . vectorImplVal . getVectorSize ( ) <EOL> def entireSlice ( self ) : <EOL> return self . getMappableSlice ( <NUM_LIT:0> , self . elementCount ) <EOL> def slicesByPage ( self ) : <EOL> if self . vectorImplVal is None : <EOL> return [ ] <EOL> return [ self . getMappableSlice ( low , high ) for low , high in <EOL> self . vectorImplVal . getVectorPageSliceRanges ( <EOL> ComputedValueGateway . getGateway ( ) . vdm <EOL> ) ] <EOL> @ ComputedGraph . Function <EOL> def getMappableSlice ( self , lowIndex , highIndex ) : <EOL> return ComputedValueVectorSlice ( <EOL> computedValueVector = self , <EOL> lowIndex = lowIndex , <EOL> highIndex = highIndex <EOL> ) <EOL> @ ComputedGraph . ExposedFunction ( expandArgs = True ) <EOL> def getSlice ( self , lowIndex , highIndex ) : <EOL> return self . getMappableSlice ( lowIndex , highIndex ) <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT:%s>" % ( self . vectorImplVal ) <EOL> class ComputedValueVectorFromComputedValue ( ComputedValueVector ) : <EOL> computedValue = ComputedGraph . Key ( object ) <EOL> def vectorImplVal ( self ) : <EOL> return self . computedValue . valueIVC <EOL> class ComputedValueVectorSlice ( ComputedGraph . Location ) : <EOL> computedValueVector = object <EOL> lowIndex = object <EOL> highIndex = object <EOL> isLoaded = ComputedGraph . Mutable ( lambda : False ) <EOL> @ ComputedGraph . NotCached <EOL> def vectorDataIds ( self ) : <EOL> if self . computedValueVector . vectorImplVal is None : <EOL> return [ ] <EOL> return self . computedValueVector . vectorImplVal . getVectorDataIdsForSlice ( <EOL> self . lowIndex , <EOL> self . highIndex , <EOL> ComputedValueGateway . getGateway ( ) . vdm <EOL> ) <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % ( <EOL> self . computedValueVector , <EOL> self . lowIndex , <EOL> self . highIndex <EOL> ) <EOL> @ ComputedGraph . Function <EOL> def extractVectorDataAsPythonArray ( self ) : <EOL> if self . computedValueVector . vectorImplVal is None : <EOL> return None <EOL> if len ( self . vectorDataIds ) > <NUM_LIT:0> and not self . isLoaded : <EOL> return None <EOL> result = ComputedValueGateway . getGateway ( ) . extractVectorDataAsPythonArray ( <EOL> self . computedValueVector , <EOL> self . lowIndex , <EOL> self . highIndex <EOL> ) <EOL> if result is None and not self . vdmThinksIsLoaded ( ) : <EOL> logging . info ( "<STR_LIT>" , self ) <EOL> self . isLoaded = False <EOL> ComputedValueGateway . getGateway ( ) . reloadVector ( self ) <EOL> return result <EOL> @ ComputedGraph . Function <EOL> def vdmThinksIsLoaded ( self ) : <EOL> return ComputedValueGateway . getGateway ( ) . vectorDataIsLoaded ( <EOL> self . computedValueVector , <EOL> self . lowIndex , <EOL> self . highIndex <EOL> ) <EOL> @ ComputedGraph . Function <EOL> def markLoaded ( self , isLoaded ) : <EOL> self . isLoaded = isLoaded <EOL> @ ComputedGraph . Function <EOL> def extractVectorDataAsNumpyArray ( self ) : <EOL> logging . info ( "<STR_LIT>" , self , self . vdmThinksIsLoaded ( ) ) <EOL> if self . computedValueVector . vectorImplVal is None : <EOL> return None <EOL> if len ( self . vectorDataIds ) > <NUM_LIT:0> and not self . isLoaded : <EOL> return None <EOL> result = ComputedValueGateway . getGateway ( ) . extractVectorDataAsNumpyArray ( <EOL> self . computedValueVector , <EOL> self . lowIndex , <EOL> self . highIndex <EOL> ) <EOL> if result is None and not self . vdmThinksIsLoaded ( ) : <EOL> logging . info ( "<STR_LIT>" , self ) <EOL> self . isLoaded = False <EOL> ComputedValueGateway . getGateway ( ) . reloadVector ( self ) <EOL> return result <EOL> @ ComputedGraph . Function <EOL> def extractVectorDataAsNumpyArrayInChunks ( self , stepSize = <NUM_LIT> ) : <EOL> """<STR_LIT>""" <EOL> if self . computedValueVector . vectorImplVal is None : <EOL> return None <EOL> if len ( self . vectorDataIds ) > <NUM_LIT:0> and not self . isLoaded : <EOL> return None <EOL> if not self . vdmThinksIsLoaded ( ) : <EOL> return None <EOL> result = [ ] <EOL> index = self . lowIndex <EOL> while index < self . highIndex and result is not None : <EOL> tailResult = ComputedValueGateway . getGateway ( ) . extractVectorDataAsNumpyArray ( <EOL> self . computedValueVector , <EOL> index , <EOL> min ( self . highIndex , index + stepSize ) <EOL> ) <EOL> index += stepSize <EOL> if tailResult is not None : <EOL> result . append ( tailResult ) <EOL> else : <EOL> result = None <EOL> if result is None and not self . vdmThinksIsLoaded ( ) : <EOL> logging . info ( "<STR_LIT>" , self ) <EOL> self . isLoaded = False <EOL> ComputedValueGateway . getGateway ( ) . reloadVector ( self ) <EOL> return result <EOL> @ ComputedGraph . Function <EOL> def extractVectorItemAsIVC ( self , ct ) : <EOL> if self . computedValueVector . vectorImplVal is None : <EOL> return None <EOL> if len ( self . vectorDataIds ) > <NUM_LIT:0> and not self . isLoaded : <EOL> return None <EOL> result = ComputedValueGateway . getGateway ( ) . extractVectorItem ( self . computedValueVector , ct ) <EOL> if result is None : <EOL> logging . info ( "<STR_LIT>" , self ) <EOL> self . isLoaded = False <EOL> ComputedValueGateway . getGateway ( ) . reloadVector ( self ) <EOL> return result <EOL> @ ComputedGraph . ExposedFunction ( ) <EOL> def getSlice ( self , lowIndex , highIndex ) : <EOL> assert lowIndex >= <NUM_LIT:0> <EOL> assert lowIndex < highIndex <EOL> assert highIndex <= self . highIndex - self . lowIndex <EOL> return ComputedValueVectorSlice ( <EOL> computedValueVector = self . computedValueVector , <EOL> lowIndex = self . lowIndex + lowIndex , <EOL> highIndex = self . lowIndex + highIndex <EOL> ) <EOL> @ ComputedGraph . ExposedFunction ( ) <EOL> def increaseRequestCount ( self , * args ) : <EOL> """<STR_LIT>""" <EOL> ComputedValueGateway . getGateway ( ) . increaseVectorRequestCount ( self ) <EOL> @ ComputedGraph . ExposedFunction ( ) <EOL> def decreaseRequestCount ( self , * args ) : <EOL> ComputedValueGateway . getGateway ( ) . decreaseVectorRequestCount ( self ) <EOL> def validateComputedValueArgs ( args ) : <EOL> """<STR_LIT>""" <EOL> if not args : <EOL> return False <EOL> if not isinstance ( args , tuple ) : <EOL> return False <EOL> for ix , a in enumerate ( args ) : <EOL> if ComputedGraph . isLocation ( a ) : <EOL> if not issubclass ( a . __location_class__ , ComputedValue ) : <EOL> logging . error ( "<STR_LIT>" , ix , a . __location_class__ ) <EOL> return False <EOL> else : <EOL> if not isinstance ( a , ( ImplValContainer_ , long , int , str , bool ) ) : <EOL> logging . error ( "<STR_LIT>" , ix , a . __class__ ) <EOL> return False <EOL> return True <EOL> class ComputedValue ( ComputedGraph . Location ) : <EOL> """<STR_LIT>""" <EOL> args = ComputedGraph . Key ( object , default = None , validator = validateComputedValueArgs ) <EOL> result = ComputedGraph . Mutable ( lambda : None ) <EOL> computationStatistics = ComputedGraph . Mutable ( lambda : None ) <EOL> def __hash__ ( self ) : <EOL> return hash ( self . hash ) <EOL> def __cmp__ ( self , other ) : <EOL> self . depth <EOL> return TypeAwareComparison . typecmp ( self , other , <EOL> lambda self , other : cmp ( self . hash , other . hash ) ) <EOL> def depth ( self ) : <EOL> """<STR_LIT>""" <EOL> tr = <NUM_LIT:0> <EOL> if self . args is None : <EOL> return <NUM_LIT:0> <EOL> for a in self . args : <EOL> try : <EOL> tr = max ( a . depth + <NUM_LIT:1> , tr ) <EOL> except AttributeError : <EOL> pass <EOL> assert tr < <NUM_LIT:50> , self <EOL> return tr <EOL> @ ComputedGraph . ExposedProperty ( ) <EOL> def asVector ( self ) : <EOL> if not self . isFinished : <EOL> return None <EOL> if self . isException : <EOL> return None <EOL> if not self . valueIVC . isVector ( ) : <EOL> return None <EOL> return ComputedValueVectorFromComputedValue ( computedValue = self ) <EOL> def computationDefinitionTerm_ ( self ) : <EOL> return CumulusNative . ComputationDefinitionTerm . Subcomputation ( <EOL> self . cumulusComputationDefinition . asRoot . terms <EOL> ) <EOL> def cumulusComputationDefinition ( self ) : <EOL> terms = [ ] <EOL> assert self . args is not None , self . __location_class__ <EOL> for a in self . args : <EOL> if isinstance ( a , ( long , int , str , bool ) ) : <EOL> terms . append ( CumulusNative . ComputationDefinitionTerm . Value ( ImplValContainer_ ( a ) , None ) ) <EOL> elif isinstance ( a , ImplValContainer_ ) : <EOL> terms . append ( CumulusNative . ComputationDefinitionTerm . Value ( a , None ) ) <EOL> else : <EOL> terms . append ( a . computationDefinitionTerm_ ) <EOL> return CumulusNative . ComputationDefinition . Root ( <EOL> CumulusNative . ImmutableTreeVectorOfComputationDefinitionTerm ( terms ) <EOL> ) <EOL> @ ComputedGraph . ExposedProperty ( ) <EOL> def submittedComputationId ( self ) : <EOL> computationId = ComputedValueGateway . getGateway ( ) . submittedComputationId ( self . cumulusComputationDefinition ) <EOL> if computationId is None : <EOL> return <EOL> return computationId . toSimple ( ) <EOL> @ ComputedGraph . ExposedFunction ( ) <EOL> def cancel ( self , * args ) : <EOL> ComputedValueGateway . getGateway ( ) . cancelComputation ( self , self . cumulusComputationDefinition ) <EOL> @ ComputedGraph . ExposedFunction ( ) <EOL> def requestComputationCheckpoint ( self , * args ) : <EOL> ComputedValueGateway . getGateway ( ) . requestComputationCheckpoint ( self , self . cumulusComputationDefinition ) <EOL> @ ComputedGraph . ExposedFunction ( ) <EOL> def increaseRequestCount ( self , * args ) : <EOL> ComputedValueGateway . getGateway ( ) . increaseRequestCount ( self , self . cumulusComputationDefinition ) <EOL> @ ComputedGraph . ExposedFunction ( ) <EOL> def triggerCompilation ( self , * args ) : <EOL> runtime = Runtime . getMainRuntime ( ) <EOL> axioms = runtime . getAxioms ( ) <EOL> compiler = runtime . getTypedForaCompiler ( ) <EOL> instructionGraph = runtime . getInstructionGraph ( ) <EOL> reasoner = ForaNative . SimpleForwardReasoner ( compiler , instructionGraph , axioms ) <EOL> frame = reasoner . reasonAboutComputationDefinition ( self . cumulusComputationDefinition ) <EOL> logging . critical ( "<STR_LIT>" , frame . exits ( ) ) <EOL> @ ComputedGraph . ExposedFunction ( ) <EOL> def decreaseRequestCount ( self , * args ) : <EOL> ComputedValueGateway . getGateway ( ) . decreaseRequestCount ( self , self . cumulusComputationDefinition ) <EOL> def totalVectorBytesReferenced ( self ) : <EOL> if self . checkpointStatus is None : <EOL> return <NUM_LIT:0> <EOL> stats = self . checkpointStatus . statistics <EOL> return ComputedValueGateway . getGateway ( ) . bytecountForBigvecs ( <EOL> self . checkpointStatus . bigvecsReferenced <EOL> ) <EOL> def totalBytesOfMemoryReferenced ( self ) : <EOL> if self . checkpointStatus is None : <EOL> return <NUM_LIT:0> <EOL> stats = self . checkpointStatus . statistics <EOL> return stats . totalBytesInMemory <EOL> def isCompletelyCheckpointed ( self ) : <EOL> if self . checkpointStatus is None : <EOL> return False <EOL> stats = self . checkpointStatus . statistics <EOL> totalSeconds = stats . timeSpentInCompiler + stats . timeSpentInInterpreter <EOL> return self . totalComputeSecondsAtLastCheckpoint + <NUM_LIT:1.0> > totalSeconds <EOL> @ ComputedGraph . ExposedProperty ( ) <EOL> def unfinishedDependentCodeLocationsAsJson ( self ) : <EOL> res = [ ] <EOL> for cv in self . rootComputedValueDependencies : <EOL> if not cv . isFinished : <EOL> cv = cv . unwrapVisualizable <EOL> cv = cv . unwrapMember <EOL> loc = cv . codeLocationDefinitionAsJson <EOL> if loc is not None : <EOL> res . append ( loc ) <EOL> else : <EOL> res . append ( str ( ComputedGraph . getLocationTypeFromLocation ( cv ) ) ) <EOL> return tuple ( res ) <EOL> @ ComputedGraph . ExposedProperty ( ) <EOL> def stats ( self ) : <EOL> if self . checkpointStatus is None : <EOL> return { } <EOL> stats = self . checkpointStatus . statistics <EOL> result = { <EOL> "<STR_LIT:status>" : { <EOL> "<STR_LIT:title>" : "<STR_LIT>" , <EOL> "<STR_LIT:value>" : "<STR_LIT>" if self . isFinished else "<STR_LIT>" + <EOL> ( ( "<STR_LIT>" % self . totalWorkerCount ) if self . totalWorkerCount > <NUM_LIT:0> else "<STR_LIT>" ) , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT:title>" : "<STR_LIT>" , <EOL> "<STR_LIT:value>" : stats . timeSpentInCompiler , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT:title>" : "<STR_LIT>" , <EOL> "<STR_LIT:value>" : stats . timeSpentInInterpreter , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT:title>" : "<STR_LIT>" , <EOL> "<STR_LIT:value>" : stats . totalSplitCount , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT:title>" : "<STR_LIT>" , <EOL> "<STR_LIT:value>" : self . totalBytesOfMemoryReferenced , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT:title>" : "<STR_LIT>" , <EOL> "<STR_LIT:value>" : self . totalVectorBytesReferenced , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> } <EOL> result [ "<STR_LIT>" ] = { <EOL> "<STR_LIT:title>" : "<STR_LIT>" , <EOL> "<STR_LIT:value>" : self . isCheckpointing , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> result [ "<STR_LIT>" ] = { <EOL> "<STR_LIT:title>" : "<STR_LIT>" , <EOL> "<STR_LIT:value>" : self . isLoadingFromCheckpoint , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> if self . totalBytesReferencedAtLastCheckpoint > <NUM_LIT:0> : <EOL> result [ "<STR_LIT>" ] = { <EOL> '<STR_LIT:title>' : "<STR_LIT>" , <EOL> '<STR_LIT:value>' : self . totalBytesReferencedAtLastCheckpoint , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> secondsAtCheckpoint = self . totalComputeSecondsAtLastCheckpoint <EOL> if secondsAtCheckpoint == <NUM_LIT:0.0> : <EOL> result [ "<STR_LIT>" ] = { <EOL> "<STR_LIT:title>" : "<STR_LIT>" , <EOL> "<STR_LIT:value>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> else : <EOL> totalSeconds = stats . timeSpentInCompiler + stats . timeSpentInInterpreter <EOL> if secondsAtCheckpoint + <NUM_LIT:1.0> >= totalSeconds : <EOL> result [ "<STR_LIT>" ] = { <EOL> "<STR_LIT:title>" : "<STR_LIT>" , <EOL> "<STR_LIT:value>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> else : <EOL> result [ "<STR_LIT>" ] = { <EOL> "<STR_LIT:title>" : "<STR_LIT>" , <EOL> "<STR_LIT:value>" : totalSeconds - secondsAtCheckpoint , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> return result <EOL> def isFailure ( self ) : <EOL> if not self . result : <EOL> return None <EOL> return self . result . isFailure ( ) <EOL> def failure ( self ) : <EOL> if not self . result : <EOL> return None <EOL> return self . result . asFailure . error . toString ( ) <EOL> @ ComputedGraph . ExposedProperty ( ) <EOL> def isException ( self ) : <EOL> if not self . result : <EOL> return None <EOL> return self . result . isException ( ) <EOL> def valueIVC ( self ) : <EOL> if not self . result : <EOL> return None <EOL> if self . result . isException ( ) : <EOL> return self . result . asException . exception <EOL> if self . result . isResult ( ) : <EOL> return self . result . asResult . result <EOL> return None <EOL> @ ComputedGraph . ExposedProperty ( ) <EOL> def isFinished ( self ) : <EOL> return self . valueIVC is not None or self . isFailure <EOL> def isEmpty ( self ) : <EOL> if not self . isFinished : <EOL> return True <EOL> if self . isException : <EOL> return False <EOL> if self . isFailure : <EOL> return False <EOL> if self . valueIVC is None : <EOL> return True <EOL> if self . isVector : <EOL> return self . valueIVC . getVectorSize ( ) == <NUM_LIT:0> <EOL> if self . valueIVC . isNothing ( ) : <EOL> return True <EOL> if self . valueIVC . isString ( ) : <EOL> return len ( self . valueIVC . pyval ) == <NUM_LIT:0> <EOL> if self . valueIVC . isTuple ( ) : <EOL> return len ( self . valueIVC ) == <NUM_LIT:0> <EOL> return False <EOL> workerCount = ComputedGraph . Mutable ( object , lambda : <NUM_LIT:0> ) <EOL> workerCountForDependentComputations = ComputedGraph . Mutable ( object , lambda : <NUM_LIT:0> ) <EOL> cacheloadCount = ComputedGraph . Mutable ( object , lambda : <NUM_LIT:0> ) <EOL> cacheloadCountForDependentComputations = ComputedGraph . Mutable ( object , lambda : <NUM_LIT:0> ) <EOL> checkpointStatus = ComputedGraph . Mutable ( object , lambda : None ) <EOL> totalComputeSecondsAtLastCheckpoint = ComputedGraph . Mutable ( object , lambda : <NUM_LIT:0.0> ) <EOL> isCheckpointing = ComputedGraph . Mutable ( object , lambda : False ) <EOL> isLoadingFromCheckpoint = ComputedGraph . Mutable ( object , lambda : False ) <EOL> rootComputedValueDependencies = ComputedGraph . Mutable ( object , lambda : ( ) ) <EOL> totalBytesReferencedAtLastCheckpoint = ComputedGraph . Mutable ( object , lambda : <NUM_LIT:0> ) <EOL> @ ComputedGraph . ExposedProperty ( ) <EOL> def totalWorkerCount ( self ) : <EOL> return self . workerCount + self . workerCountForDependentComputations <EOL> def codeLocationDefinitionAsJson ( self ) : <EOL> return None <EOL> @ ComputedGraph . ExposedProperty ( ) <EOL> def totalCacheloadCount ( self ) : <EOL> return self . cacheloadCount + self . cacheloadCountForDependentComputations <EOL> def __str__ ( self ) : <EOL> if self . args is None : <EOL> return "<STR_LIT>" <EOL> return "<STR_LIT>" + str ( tuple ( self . args ) ) <EOL> def hash ( self ) : <EOL> h0 = self . hashValue_ ( self . args [ <NUM_LIT:0> ] ) <EOL> for arg in self . args [ <NUM_LIT:1> : ] : <EOL> h0 = h0 + self . hashValue_ ( arg ) <EOL> return h0 <EOL> @ ComputedGraph . Function <EOL> def hashValue_ ( self , value ) : <EOL> if hasattr ( value , '<STR_LIT>' ) : <EOL> return value . hash <EOL> logging . debug ( "<STR_LIT>" , type ( value ) , str ( value ) ) <EOL> hashValue = ctypes . c_uint32 ( hash ( value ) ) . value <EOL> return Hash . Hash ( hashValue ) <EOL> def isVector ( self ) : <EOL> if self . isFailure : <EOL> return False <EOL> if self . valueIVC is None : <EOL> return False <EOL> return self . valueIVC . isVector ( ) <EOL> @ ComputedGraph . ExposedFunction ( expandArgs = True ) <EOL> def writeToS3 ( self , bucketname , keyname ) : <EOL> """<STR_LIT>""" <EOL> if not isinstance ( bucketname , str ) : <EOL> raise Exceptions . SubscribableWebObjectsException ( "<STR_LIT>" ) <EOL> if not isinstance ( keyname , str ) : <EOL> raise Exceptions . SubscribableWebObjectsException ( "<STR_LIT>" ) <EOL> if self . valueIVC is None : <EOL> return None <EOL> task = WriteToS3Task . WriteToS3Task ( computedValue = self , bucketname = bucketname , keyname = keyname ) <EOL> task . trigger ( ) <EOL> return task <EOL> class ComputedValueForMember ( ComputedValue ) : <EOL> baseComputedValue = object <EOL> memberName = object <EOL> def args ( self ) : <EOL> return ( self . baseComputedValue , ForaNative . makeSymbol ( "<STR_LIT>" ) , ForaNative . makeSymbol ( self . memberName ) ) </s>
