code: def _ExerciseDynamicClass(self, cls):
      msg = cls()
      msg.mandatory = 42
      msg.nested_factory_2_enum = 0
      msg.nested_factory_2_message.value = "nested message value"
      msg.factory_1_message.factory_1_enum = 1
      msg.factory_1_message.nested_factory_1_enum = 0
      msg.factory_1_message.nested_factory_1_message.value = (
          "nested message value"
      )
      msg.factory_1_message.scalar_value = 22
      msg.factory_1_message.list_value.extend(["one", "two", "three"])
      msg.factory_1_message.list_value.append("four")
      msg.factory_1_enum = 1
      msg.nested_factory_1_enum = 0
      msg.nested_factory_1_message.value = "nested message value"
      msg.circular_message.mandatory = 1
      msg.circular_message.circular_message.mandatory = 2
      msg.circular_message.scalar_value = "one deep"
      msg.scalar_value = "zero deep"
      msg.list_value.extend(["four", "three", "two"])
      msg.list_value.append("one")
      msg.grouped.add()
      msg.grouped[0].part_1 = "hello"
      msg.grouped[0].part_2 = "world"
      msg.grouped.add(part_1="testing", part_2="123")
      msg.loop.loop.mandatory = 2
      msg.loop.loop.loop.loop.mandatory = 4
      serialized = msg.SerializeToString()
      converted = factory_test2_pb2.Factory2Message.FromString(
          serialized
      )
      reserialized = converted.SerializeToString()
      self.assertEqual(serialized, reserialized)
      result = cls.FromString(reserialized)
      self.assertEqual(msg, result)
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/message_factory_test.py
imports: from google.protobuf import descriptor_pb2
  from google.protobuf.internal import factory_test1_pb2
  from google.protobuf.internal import factory_test2_pb2
  from google.protobuf import descriptor_database
  from google.protobuf import descriptor_pool
  from google.protobuf import message_factory
label_desc: Use image node_id 2 for calling the MessageFactoryTest obj's underlying member method code with example usage: obj._ExerciseDynamicClass(cls) without return types