<s> """<STR_LIT>""" <EOL> import numpy as np <EOL> def euclidean_dist_matrix ( data_1 , data_2 ) : <EOL> """<STR_LIT>""" <EOL> norms_1 = ( data_1 ** <NUM_LIT:2> ) . sum ( axis = <NUM_LIT:1> ) <EOL> norms_2 = ( data_2 ** <NUM_LIT:2> ) . sum ( axis = <NUM_LIT:1> ) <EOL> return np . abs ( norms_1 . reshape ( - <NUM_LIT:1> , <NUM_LIT:1> ) + norms_2 - <NUM_LIT:2> * np . dot ( data_1 , data_2 . T ) ) </s>
