#NEWLINE# def _build_metadata( self , year , elections ) : #NEWLINE# #INDENT# meta_entries = [ ] #NEWLINE# for election in elections : #NEWLINE# #INDENT# slug = election [ 'slug' ] #NEWLINE# from_url_paths = self . _url_paths_metadata ( election ) #NEWLINE# if ( len ( from_url_paths ) > 0 ) : #NEWLINE# #INDENT# meta_entries . extend ( from_url_paths ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# meta_entries . extend ( self . _direct_links_metadata ( election ) ) #NEWLINE# #UNINDENT# if ( ( int ( year ) >= 2006 ) and ( election [ 'race_type' ] in ( 'primary' , 'general' ) ) and ( not election [ 'special' ] ) ) : #NEWLINE# #INDENT# meta_entries . extend ( self . _precinct_xls_metadata ( election ) ) #NEWLINE# #UNINDENT# #UNINDENT# return self . _add_preprocessed_urls ( meta_entries )