#NEWLINE# def camelCaseToUpper( input ) : #NEWLINE# #INDENT# if ( input . upper ( ) == input ) : #NEWLINE# #INDENT# return input #NEWLINE# #UNINDENT# result = [ ] #NEWLINE# for char in input : #NEWLINE# #INDENT# conv = char . upper ( ) #NEWLINE# if ( ( char == conv ) and ( len ( result ) > 0 ) ) : #NEWLINE# #INDENT# result . append ( '_' ) #NEWLINE# #UNINDENT# result . append ( conv ) #NEWLINE# #UNINDENT# return '' . join ( char )