code: def SetAllExtensions(message):
      """Sets every extension in the message to a unique value.
  
      Args:
        message: A unittest_pb2.TestAllExtensions instance.
      """
  
      extensions = message.Extensions
      pb2 = unittest_pb2
      import_pb2 = unittest_import_pb2
  
      #
      # Optional fields.
      #
  
      extensions[pb2.optional_int32_extension] = 101
      extensions[pb2.optional_int64_extension] = 102
      extensions[pb2.optional_uint32_extension] = 103
      extensions[pb2.optional_uint64_extension] = 104
      extensions[pb2.optional_sint32_extension] = 105
      extensions[pb2.optional_sint64_extension] = 106
      extensions[pb2.optional_fixed32_extension] = 107
      extensions[pb2.optional_fixed64_extension] = 108
      extensions[pb2.optional_sfixed32_extension] = 109
      extensions[pb2.optional_sfixed64_extension] = 110
      extensions[pb2.optional_float_extension] = 111
      extensions[pb2.optional_double_extension] = 112
      extensions[pb2.optional_bool_extension] = True
      extensions[pb2.optional_string_extension] = "115"
      extensions[pb2.optional_bytes_extension] = "116"
  
      extensions[pb2.optionalgroup_extension].a = 117
      extensions[pb2.optional_nested_message_extension].bb = 118
      extensions[pb2.optional_foreign_message_extension].c = 119
      extensions[pb2.optional_import_message_extension].d = 120
      extensions[pb2.optional_public_import_message_extension].e = 126
      extensions[pb2.optional_lazy_message_extension].bb = 127
  
      extensions[
          pb2.optional_nested_enum_extension
      ] = pb2.TestAllTypes.BAZ
      extensions[
          pb2.optional_nested_enum_extension
      ] = pb2.TestAllTypes.BAZ
      extensions[pb2.optional_foreign_enum_extension] = pb2.FOREIGN_BAZ
      extensions[
          pb2.optional_import_enum_extension
      ] = import_pb2.IMPORT_BAZ
  
      extensions[pb2.optional_string_piece_extension] = "124"
      extensions[pb2.optional_cord_extension] = "125"
  
      #
      # Repeated fields.
      #
  
      extensions[pb2.repeated_int32_extension].append(201)
      extensions[pb2.repeated_int64_extension].append(202)
      extensions[pb2.repeated_uint32_extension].append(203)
      extensions[pb2.repeated_uint64_extension].append(204)
      extensions[pb2.repeated_sint32_extension].append(205)
      extensions[pb2.repeated_sint64_extension].append(206)
      extensions[pb2.repeated_fixed32_extension].append(207)
      extensions[pb2.repeated_fixed64_extension].append(208)
      extensions[pb2.repeated_sfixed32_extension].append(209)
      extensions[pb2.repeated_sfixed64_extension].append(210)
      extensions[pb2.repeated_float_extension].append(211)
      extensions[pb2.repeated_double_extension].append(212)
      extensions[pb2.repeated_bool_extension].append(True)
      extensions[pb2.repeated_string_extension].append("215")
      extensions[pb2.repeated_bytes_extension].append("216")
  
      extensions[pb2.repeatedgroup_extension].add().a = 217
      extensions[pb2.repeated_nested_message_extension].add().bb = 218
      extensions[pb2.repeated_foreign_message_extension].add().c = 219
      extensions[pb2.repeated_import_message_extension].add().d = 220
      extensions[pb2.repeated_lazy_message_extension].add().bb = 227
  
      extensions[pb2.repeated_nested_enum_extension].append(
          pb2.TestAllTypes.BAR
      )
      extensions[pb2.repeated_foreign_enum_extension].append(
          pb2.FOREIGN_BAR
      )
      extensions[pb2.repeated_import_enum_extension].append(
          import_pb2.IMPORT_BAR
      )
  
      extensions[pb2.repeated_string_piece_extension].append("224")
      extensions[pb2.repeated_cord_extension].append("225")
  
      # Append a second one of each field.
      extensions[pb2.repeated_int32_extension].append(301)
      extensions[pb2.repeated_int64_extension].append(302)
      extensions[pb2.repeated_uint32_extension].append(303)
      extensions[pb2.repeated_uint64_extension].append(304)
      extensions[pb2.repeated_sint32_extension].append(305)
      extensions[pb2.repeated_sint64_extension].append(306)
      extensions[pb2.repeated_fixed32_extension].append(307)
      extensions[pb2.repeated_fixed64_extension].append(308)
      extensions[pb2.repeated_sfixed32_extension].append(309)
      extensions[pb2.repeated_sfixed64_extension].append(310)
      extensions[pb2.repeated_float_extension].append(311)
      extensions[pb2.repeated_double_extension].append(312)
      extensions[pb2.repeated_bool_extension].append(False)
      extensions[pb2.repeated_string_extension].append("315")
      extensions[pb2.repeated_bytes_extension].append("316")
  
      extensions[pb2.repeatedgroup_extension].add().a = 317
      extensions[pb2.repeated_nested_message_extension].add().bb = 318
      extensions[pb2.repeated_foreign_message_extension].add().c = 319
      extensions[pb2.repeated_import_message_extension].add().d = 320
      extensions[pb2.repeated_lazy_message_extension].add().bb = 327
  
      extensions[pb2.repeated_nested_enum_extension].append(
          pb2.TestAllTypes.BAZ
      )
      extensions[pb2.repeated_foreign_enum_extension].append(
          pb2.FOREIGN_BAZ
      )
      extensions[pb2.repeated_import_enum_extension].append(
          import_pb2.IMPORT_BAZ
      )
  
      extensions[pb2.repeated_string_piece_extension].append("324")
      extensions[pb2.repeated_cord_extension].append("325")
  
      #
      # Fields with defaults.
      #
  
      extensions[pb2.default_int32_extension] = 401
      extensions[pb2.default_int64_extension] = 402
      extensions[pb2.default_uint32_extension] = 403
      extensions[pb2.default_uint64_extension] = 404
      extensions[pb2.default_sint32_extension] = 405
      extensions[pb2.default_sint64_extension] = 406
      extensions[pb2.default_fixed32_extension] = 407
      extensions[pb2.default_fixed64_extension] = 408
      extensions[pb2.default_sfixed32_extension] = 409
      extensions[pb2.default_sfixed64_extension] = 410
      extensions[pb2.default_float_extension] = 411
      extensions[pb2.default_double_extension] = 412
      extensions[pb2.default_bool_extension] = False
      extensions[pb2.default_string_extension] = "415"
      extensions[pb2.default_bytes_extension] = "416"
  
      extensions[
          pb2.default_nested_enum_extension
      ] = pb2.TestAllTypes.FOO
      extensions[pb2.default_foreign_enum_extension] = pb2.FOREIGN_FOO
      extensions[
          pb2.default_import_enum_extension
      ] = import_pb2.IMPORT_FOO
  
      extensions[pb2.default_string_piece_extension] = "424"
      extensions[pb2.default_cord_extension] = "425"
  
file_path: coremltools/deps/protobuf/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/test_util.py
imports: import os.path
  from google.protobuf import unittest_import_pb2
  from google.protobuf import unittest_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: SetAllExtensions(message) without return types