def PrintMessage(self, message):
fields = message.ListFields()<EOL>if self.use_index_order:<EOL><INDENT>fields.sort(key=lambda x: x[<NUM_LIT:0>].index)<EOL><DEDENT>for field, value in fields:<EOL><INDENT>if _IsMapEntry(field):<EOL><INDENT>for key in sorted(value):<EOL><INDENT>entry_submsg = field.message_type._concrete_class(<EOL>key=key, value=value[key])<EOL>self.PrintField(field, entry_submsg)<EOL><DEDENT><DEDENT>elif field.label == descriptor.FieldDescriptor.LABEL_REPEATED:<EOL><INDENT>for element in value:<EOL><INDENT>self.PrintField(field, element)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.PrintField(field, value)<EOL><DEDENT><DEDENT>
Convert protobuf message to text format.

        Args:
          message: The protocol buffers message.