#NEWLINE# def read_fft( genre_list , base_dir = GENRE_DIR ) : #NEWLINE# #INDENT# X = [ ] #NEWLINE# y = [ ] #NEWLINE# for ( label , genre ) in enumerate ( genre_list ) : #NEWLINE# #INDENT# genre_dir = os . path . join ( base_dir , genre , '*.fft.npy' ) #NEWLINE# file_list = glob . glob ( genre_dir ) #NEWLINE# assert file_list , genre_dir #NEWLINE# for fn in file_list : #NEWLINE# #INDENT# fft_features = np . load ( fn ) #NEWLINE# X . append ( fft_features [ : 2000 ] ) #NEWLINE# y . append ( y ) #NEWLINE# #UNINDENT# #UNINDENT# return ( np . array ( X ) , np . array ( y ) )