code: def testPrintMessageSet(self):
      message = unittest_mset_pb2.TestMessageSetContainer()
      ext1 = (
          unittest_mset_pb2.TestMessageSetExtension1.message_set_extension
      )
      ext2 = (
          unittest_mset_pb2.TestMessageSetExtension2.message_set_extension
      )
      message.message_set.Extensions[ext1].i = 23
      message.message_set.Extensions[ext2].str = "foo"
      self.CompareToGoldenText(
          text_format.MessageToString(message),
          "message_set {\n"
          "  [protobuf_unittest.TestMessageSetExtension1] {\n"
          "    i: 23\n"
          "  }\n"
          "  [protobuf_unittest.TestMessageSetExtension2] {\n"
          '    str: "foo"\n'
          "  }\n"
          "}\n",
      )
  
imports: import difflib
  import re
  import unittest
  from google.protobuf import text_format
  from google.protobuf.internal import test_util
  from google.protobuf import unittest_pb2
  from google.protobuf import unittest_mset_pb2
label_desc: Use image node_id 7 for calling the TextFormatTest obj's underlying member method code with example usage: obj.testPrintMessageSet() without return types