#NEWLINE# def _run_ems( objective_function , data , cond_idx , train , test ) : #NEWLINE# #INDENT# d = objective_function ( * ( data [ np . intersect1d ( c , train ) ] for c in cond_idx ) ) #NEWLINE# d /= np . sqrt ( np . sum ( ( d ** 2 ) , axis = 0 ) ) [ None , : ] #NEWLINE# return ( np . sum ( ( data [ test [ 0 ] ] * d ) , axis = 0 ) , d )