#NEWLINE# @ staticmethod #NEWLINE# def mult_function( mult_dict , line ) : #NEWLINE# #INDENT# "\n        Construct a multiplier for the 'FUNCTION' option\n\n        " #NEWLINE# t = line . strip ( ) . split ( ) #NEWLINE# basename = t . pop ( 0 ) . lower ( ) #NEWLINE# multarray = mult_dict [ basename ] #NEWLINE# multarray = multarray . array . copy ( ) #NEWLINE# while True : #NEWLINE# #INDENT# if ( len ( t ) < 2 ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# op = t . pop ( 0 ) #NEWLINE# multname = t . pop ( 0 ) #NEWLINE# atemp = mult_dict [ multname . lower ( ) ] . array #NEWLINE# if ( op == '+' ) : #NEWLINE# #INDENT# multarray = ( multarray + atemp ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( op == '*' ) : #NEWLINE# #INDENT# multarray = ( multarray * atemp ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( op == '-' ) : #NEWLINE# #INDENT# multarray = ( multarray - atemp ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( op == '/' ) : #NEWLINE# #INDENT# multarray = ( multarray / atemp ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# s = 'Invalid MULT operation {}' . format ( op ) #NEWLINE# raise Exception ( s ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return multarray