code: def testSerializeMessageSetWireFormatUnknownExtension(self):
      # Create a message using the message set wire format with an unknown
      # message.
      raw = unittest_mset_pb2.RawMessageSet()
  
      # Add an unknown extension.
      item = raw.item.add()
      item.type_id = 98418603
      message1 = message_set_extensions_pb2.TestMessageSetExtension1()
      message1.i = 12345
      item.message = message1.SerializeToString()
  
      serialized = raw.SerializeToString()
  
      # Parse message using the message set wire format.
      proto = message_set_extensions_pb2.TestMessageSet()
      proto.MergeFromString(serialized)
  
      # Verify that the unknown extension is serialized unchanged
      reserialized = proto.SerializeToString()
      new_raw = unittest_mset_pb2.RawMessageSet()
      new_raw.MergeFromString(reserialized)
      self.assertEqual(raw, new_raw)
  
imports: from google.protobuf import unittest_mset_pb2
  from google.protobuf import unittest_pb2
  from google.protobuf import unittest_proto3_arena_pb2
  from google.protobuf.internal import api_implementation
  from google.protobuf.internal import encoder
  from google.protobuf.internal import message_set_extensions_pb2
  from google.protobuf.internal import missing_enum_values_pb2
  from google.protobuf.internal import test_util
  from google.protobuf.internal import testing_refleaks
  from google.protobuf.internal import type_checkers
label_desc: Use image node_id 6 for calling the UnknownFieldsTest obj's underlying member method code with example usage: obj.testSerializeMessageSetWireFormatUnknownExtension() without return types