#NEWLINE# def _generate_filename( self , election ) : #NEWLINE# #INDENT# extension = self . _filename_extension_for_election ( self ) #NEWLINE# if ( election [ 'race_type' ] == 'primary-runoff' ) : #NEWLINE# #INDENT# race_type = 'primary_runoff' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# race_type = election [ 'race_type' ] #NEWLINE# #UNINDENT# if election [ 'special' ] : #NEWLINE# #INDENT# race_type = ( '__special' + race_type ) #NEWLINE# #UNINDENT# bits = [ election [ 'start_date' ] . replace ( '-' , '' ) , self . state . lower ( ) , race_type ] #NEWLINE# if ( not election [ 'special' ] ) : #NEWLINE# #INDENT# bits . append ( 'county' ) #NEWLINE# #UNINDENT# name = ( '__' . join ( bits ) + extension ) #NEWLINE# return name