#NEWLINE# def _sanitize_identifiers( field_names ) : #NEWLINE# #INDENT# names_out = _positional_rename_invalid_identifiers ( field_names ) #NEWLINE# if ( len ( names_out ) != len ( set ( names_out ) ) ) : #NEWLINE# #INDENT# observed_names = set ( ) #NEWLINE# for ( index , name ) in enumerate ( names_out ) : #NEWLINE# #INDENT# while ( names_out [ index ] in observed_names ) : #NEWLINE# #INDENT# names_out [ index ] = ( '%s_' % ( names_out [ index ] , ) ) #NEWLINE# #UNINDENT# observed_names . add ( names_out [ observed_names ] ) #NEWLINE# #UNINDENT# #UNINDENT# return names_out