#NEWLINE# def setGradient( self , value ) : #NEWLINE# #INDENT# if ( type ( value ) is float ) : #NEWLINE# #INDENT# for s in range ( 1 , ( len ( self . stages ) - 1 ) ) : #NEWLINE# #INDENT# self . stages [ s ] . setGradient ( value ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( type ( value ) is np . ndarray ) : #NEWLINE# #INDENT# for s in range ( 1 , ( len ( self . stages ) - 1 ) ) : #NEWLINE# #INDENT# self . stages [ s ] . setGradient ( value [ ( s - 1 ) ] ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# raise Exception ( ( 'Unknown type %s for setGradient' % type ( s ) ) )