def _set_protobuf_value(value_pb, val):
 (attr, val) = _pb_attr_value(val)
 if (attr == 'key_value'):
  value_pb.key_value.CopyFrom(val)
 elif (attr == 'timestamp_value'):
  value_pb.timestamp_value.CopyFrom(val)
 elif (attr == 'entity_value'):
  entity_pb = entity_to_protobuf(val)
  value_pb.entity_value.CopyFrom(entity_pb)
 elif (attr == 'array_value'):
  l_pb = value_pb.array_value.values
  for item in val:
   i_pb = l_pb.add()
   _set_protobuf_value(i_pb, item)
 elif (attr == 'geo_point_value'):
  value_pb.geo_point_value.CopyFrom(val)
 else:
  setattr(value_pb, attr, val)

def _set_protobuf_value ( value_pb , val ) : ( attr , val ) = _pb_attr_value ( val ) if ( attr == 'key_value' ) : value_pb . key_value . CopyFrom ( val ) elif ( attr == 'timestamp_value' ) : value_pb . timestamp_value . CopyFrom ( val ) elif ( attr == 'entity_value' ) : entity_pb = entity_to_protobuf ( val ) value_pb . entity_value . CopyFrom ( entity_pb ) elif ( attr == 'array_value' ) : l_pb = value_pb . array_value . values for item in val : i_pb = l_pb . add ( ) _set_protobuf_value ( i_pb , item ) elif ( attr == 'geo_point_value' ) : value_pb . geo_point_value . CopyFrom ( val ) else : setattr ( value_pb , attr , val )
assign val to the correct subfield of value_pb .