code: def testHasDefaultValues(self):
      desc = unittest_pb2.TestAllTypes.DESCRIPTOR
  
      expected_has_default_by_name = {
          "optional_int32": False,
          "repeated_int32": False,
          "optional_nested_message": False,
          "default_int32": True,
      }
  
      has_default_by_name = dict(
          [
              (f.name, f.has_default_value)
              for f in desc.fields
              if f.name in expected_has_default_by_name
          ]
      )
      self.assertEqual(
          expected_has_default_by_name, has_default_by_name
      )
  
imports: import unittest
  from google.protobuf.internal import test_bad_identifiers_pb2
  from google.protobuf import unittest_custom_options_pb2
  from google.protobuf import unittest_import_pb2
  from google.protobuf import unittest_import_public_pb2
  from google.protobuf import unittest_mset_pb2
  from google.protobuf import unittest_pb2
  from google.protobuf import unittest_no_generic_services_pb2
  from google.protobuf import service
label_desc: Use image node_id 4 for calling the GeneratorTest obj's underlying member method code with example usage: obj.testHasDefaultValues() without return types