def SetAllNonLazyFields(message):
  """Sets every non-lazy field in the message to a unique value.

  Args:
    message: A TestAllTypes instance.
  """

  #
  # Optional fields.
  #

  message.optional_int32    = 101
  message.optional_int64    = 102
  message.optional_uint32   = 103
  message.optional_uint64   = 104
  message.optional_sint32   = 105
  message.optional_sint64   = 106
  message.optional_fixed32  = 107
  message.optional_fixed64  = 108
  message.optional_sfixed32 = 109
  message.optional_sfixed64 = 110
  message.optional_float    = 111
  message.optional_double   = 112
  message.optional_bool     = True
  message.optional_string   = u'115'
  message.optional_bytes    = b'116'

  if IsProto2(message):
    message.optionalgroup.a = 117
  message.optional_nested_message.bb = 118
  message.optional_foreign_message.c = 119
  message.optional_import_message.d = 120
  message.optional_public_import_message.e = 126

  message.optional_nested_enum = unittest_pb2.TestAllTypes.BAZ
  message.optional_foreign_enum = unittest_pb2.FOREIGN_BAZ
  if IsProto2(message):
    message.optional_import_enum = unittest_import_pb2.IMPORT_BAZ

  message.optional_string_piece = u'124'
  message.optional_cord = u'125'

  #
  # Repeated fields.
  #

  message.repeated_int32.append(201)
  message.repeated_int64.append(202)
  message.repeated_uint32.append(203)
  message.repeated_uint64.append(204)
  message.repeated_sint32.append(205)
  message.repeated_sint64.append(206)
  message.repeated_fixed32.append(207)
  message.repeated_fixed64.append(208)
  message.repeated_sfixed32.append(209)
  message.repeated_sfixed64.append(210)
  message.repeated_float.append(211)
  message.repeated_double.append(212)
  message.repeated_bool.append(True)
  message.repeated_string.append(u'215')
  message.repeated_bytes.append(b'216')

  if IsProto2(message):
    message.repeatedgroup.add().a = 217
  message.repeated_nested_message.add().bb = 218
  message.repeated_foreign_message.add().c = 219
  message.repeated_import_message.add().d = 220
  message.repeated_lazy_message.add().bb = 227

  message.repeated_nested_enum.append(unittest_pb2.TestAllTypes.BAR)
  message.repeated_foreign_enum.append(unittest_pb2.FOREIGN_BAR)
  if IsProto2(message):
    message.repeated_import_enum.append(unittest_import_pb2.IMPORT_BAR)

  message.repeated_string_piece.append(u'224')
  message.repeated_cord.append(u'225')

  # Add a second one of each field and set value by index.
  message.repeated_int32.append(0)
  message.repeated_int64.append(0)
  message.repeated_uint32.append(0)
  message.repeated_uint64.append(0)
  message.repeated_sint32.append(0)
  message.repeated_sint64.append(0)
  message.repeated_fixed32.append(0)
  message.repeated_fixed64.append(0)
  message.repeated_sfixed32.append(0)
  message.repeated_sfixed64.append(0)
  message.repeated_float.append(0)
  message.repeated_double.append(0)
  message.repeated_bool.append(True)
  message.repeated_string.append(u'0')
  message.repeated_bytes.append(b'0')
  message.repeated_int32[1] = 301
  message.repeated_int64[1] = 302
  message.repeated_uint32[1] = 303
  message.repeated_uint64[1] = 304
  message.repeated_sint32[1] = 305
  message.repeated_sint64[1] = 306
  message.repeated_fixed32[1] = 307
  message.repeated_fixed64[1] = 308
  message.repeated_sfixed32[1] = 309
  message.repeated_sfixed64[1] = 310
  message.repeated_float[1] = 311
  message.repeated_double[1] = 312
  message.repeated_bool[1] = False
  message.repeated_string[1] = u'315'
  message.repeated_bytes[1] = b'316'

  if IsProto2(message):
    message.repeatedgroup.add().a = 317
  message.repeated_nested_message.add().bb = 318
  message.repeated_foreign_message.add().c = 319
  message.repeated_import_message.add().d = 320
  message.repeated_lazy_message.add().bb = 327

  message.repeated_nested_enum.append(unittest_pb2.TestAllTypes.BAR)
  message.repeated_nested_enum[1] = unittest_pb2.TestAllTypes.BAZ
  message.repeated_foreign_enum.append(unittest_pb2.FOREIGN_BAZ)
  if IsProto2(message):
    message.repeated_import_enum.append(unittest_import_pb2.IMPORT_BAZ)

  message.repeated_string_piece.append(u'324')
  message.repeated_cord.append(u'325')

  #
  # Fields that have defaults.
  #

  if IsProto2(message):
    message.default_int32 = 401
    message.default_int64 = 402
    message.default_uint32 = 403
    message.default_uint64 = 404
    message.default_sint32 = 405
    message.default_sint64 = 406
    message.default_fixed32 = 407
    message.default_fixed64 = 408
    message.default_sfixed32 = 409
    message.default_sfixed64 = 410
    message.default_float = 411
    message.default_double = 412
    message.default_bool = False
    message.default_string = '415'
    message.default_bytes = b'416'

    message.default_nested_enum = unittest_pb2.TestAllTypes.FOO
    message.default_foreign_enum = unittest_pb2.FOREIGN_FOO
    message.default_import_enum = unittest_import_pb2.IMPORT_FOO

    message.default_string_piece = '424'
    message.default_cord = '425'

  message.oneof_uint32 = 601
  message.oneof_nested_message.bb = 602
  message.oneof_string = '603'
  message.oneof_bytes = b'604'
Sets every non-lazy field in the message to a unique value.

  Args:
    message: A TestAllTypes instance.
  
deps/protobuf/python/google/protobuf/internal/test_util.py