#NEWLINE# def PrintMessage( message , out , indent = 0 , as_utf8 = False , as_one_line = False , pointy_brackets = False , use_index_order = False , float_format = None ) : #NEWLINE# #INDENT# fields = message . ListFields ( ) #NEWLINE# if use_index_order : #NEWLINE# #INDENT# fields . sort ( key = ( lambda x : x [ 0 ] . index ) ) #NEWLINE# #UNINDENT# for ( field , value ) in fields : #NEWLINE# #INDENT# if _IsMapEntry ( field ) : #NEWLINE# #INDENT# for key in sorted ( value ) : #NEWLINE# #INDENT# entry_submsg = field . message_type . _concrete_class ( key = key , value = value [ key ] ) #NEWLINE# PrintField ( field , entry_submsg , out , indent , as_utf8 , as_one_line , pointy_brackets = pointy_brackets , use_index_order = use_index_order , float_format = float_format ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( field . label == descriptor . FieldDescriptor . LABEL_REPEATED ) : #NEWLINE# #INDENT# for element in value : #NEWLINE# #INDENT# PrintField ( field , element , out , indent , as_utf8 , as_one_line , pointy_brackets = pointy_brackets , use_index_order = use_index_order , float_format = float_format ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# PrintField ( field , value , out , indent , as_utf8 , as_one_line , pointy_brackets = pointy_brackets , use_index_order = use_index_order , float_format = float_format )