code: def testComplexExtensionOptions(self):
      descriptor = (
          unittest_custom_options_pb2.VariousComplexOptions.DESCRIPTOR
      )
      options = descriptor.GetOptions()
      self.assertEqual(
          42,
          options.Extensions[
              unittest_custom_options_pb2.complex_opt1
          ].foo,
      )
      self.assertEqual(
          324,
          options.Extensions[
              unittest_custom_options_pb2.complex_opt1
          ].Extensions[unittest_custom_options_pb2.quux],
      )
      self.assertEqual(
          876,
          options.Extensions[unittest_custom_options_pb2.complex_opt1]
          .Extensions[unittest_custom_options_pb2.corge]
          .qux,
      )
      self.assertEqual(
          987,
          options.Extensions[
              unittest_custom_options_pb2.complex_opt2
          ].baz,
      )
      self.assertEqual(
          654,
          options.Extensions[
              unittest_custom_options_pb2.complex_opt2
          ].Extensions[unittest_custom_options_pb2.grault],
      )
      self.assertEqual(
          743,
          options.Extensions[
              unittest_custom_options_pb2.complex_opt2
          ].bar.foo,
      )
      self.assertEqual(
          1999,
          options.Extensions[
              unittest_custom_options_pb2.complex_opt2
          ].bar.Extensions[unittest_custom_options_pb2.quux],
      )
      self.assertEqual(
          2008,
          options.Extensions[unittest_custom_options_pb2.complex_opt2]
          .bar.Extensions[unittest_custom_options_pb2.corge]
          .qux,
      )
      self.assertEqual(
          741,
          options.Extensions[unittest_custom_options_pb2.complex_opt2]
          .Extensions[unittest_custom_options_pb2.garply]
          .foo,
      )
      self.assertEqual(
          1998,
          options.Extensions[unittest_custom_options_pb2.complex_opt2]
          .Extensions[unittest_custom_options_pb2.garply]
          .Extensions[unittest_custom_options_pb2.quux],
      )
      self.assertEqual(
          2121,
          options.Extensions[unittest_custom_options_pb2.complex_opt2]
          .Extensions[unittest_custom_options_pb2.garply]
          .Extensions[unittest_custom_options_pb2.corge]
          .qux,
      )
      self.assertEqual(
          1971,
          options.Extensions[
              unittest_custom_options_pb2.ComplexOptionType2.ComplexOptionType4.complex_opt4
          ].waldo,
      )
      self.assertEqual(
          321,
          options.Extensions[
              unittest_custom_options_pb2.complex_opt2
          ].fred.waldo,
      )
      self.assertEqual(
          9,
          options.Extensions[
              unittest_custom_options_pb2.complex_opt3
          ].qux,
      )
      self.assertEqual(
          22,
          options.Extensions[
              unittest_custom_options_pb2.complex_opt3
          ].complexoptiontype5.plugh,
      )
      self.assertEqual(
          24,
          options.Extensions[
              unittest_custom_options_pb2.complexopt6
          ].xyzzy,
      )
  
imports: import sys
  from google.protobuf import unittest_custom_options_pb2
  from google.protobuf import unittest_import_pb2
  from google.protobuf import unittest_pb2
  from google.protobuf import descriptor_pb2
  from google.protobuf.internal import api_implementation
  from google.protobuf.internal import test_util
  from google.protobuf import descriptor
  from google.protobuf import descriptor_pool
  from google.protobuf import symbol_database
  from google.protobuf import text_format
label_desc: Use image node_id 10 for calling the DescriptorTest obj's underlying member method code with example usage: obj.testComplexExtensionOptions() without return types