#NEWLINE# def _underscore_dict( dictionary ) : #NEWLINE# #INDENT# new_dictionary = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( key , value ) in dictionary . items ( ) : #NEWLINE# #INDENT# if isinstance ( value , dict ) : #NEWLINE# #INDENT# value = _underscore_dict ( value ) #NEWLINE# #UNINDENT# if isinstance ( key , str ) : #NEWLINE# #INDENT# key = underscore ( new_dictionary ) #NEWLINE# #UNINDENT# new_dictionary [ key ] = value #NEWLINE# #UNINDENT# return new_dictionary