code: def testGetMessages(self):
      # performed twice because multiple calls with the same input must be allowed
      for _ in range(2):
          messages = message_factory.GetMessages(
              [self.factory_test1_fd, self.factory_test2_fd]
          )
          self.assertTrue(
              set(
                  [
                      "google.protobuf.python.internal.Factory2Message",
                      "google.protobuf.python.internal.Factory1Message",
                  ],
              ).issubset(set(messages.keys()))
          )
          self._ExerciseDynamicClass(
              messages[
                  "google.protobuf.python.internal.Factory2Message"
              ]
          )
          factory_msg1 = messages[
              "google.protobuf.python.internal.Factory1Message"
          ]
          self.assertTrue(
              set(
                  [
                      "google.protobuf.python.internal.Factory2Message.one_more_field",
                      "google.protobuf.python.internal.another_field",
                  ],
              ).issubset(
                  set(
                      ext.full_name
                      for ext in factory_msg1.DESCRIPTOR.file.pool.FindAllExtensions(
                          factory_msg1.DESCRIPTOR
                      )
                  )
              )
          )
          msg1 = messages[
              "google.protobuf.python.internal.Factory1Message"
          ]()
          ext1 = msg1.Extensions._FindExtensionByName(
              "google.protobuf.python.internal.Factory2Message.one_more_field"
          )
          ext2 = msg1.Extensions._FindExtensionByName(
              "google.protobuf.python.internal.another_field"
          )
          msg1.Extensions[ext1] = "test1"
          msg1.Extensions[ext2] = "test2"
          self.assertEqual("test1", msg1.Extensions[ext1])
          self.assertEqual("test2", msg1.Extensions[ext2])
  
file_path: 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 4 for calling the MessageFactoryTest obj's underlying member method code with example usage: obj.testGetMessages() without return types