def validate_value(self, constraint, value):
    if value.HasField('string_value'):
      _assert_valid_utf8(value.string_value, 'string value')
    elif value.HasField('timestamp_value'):
      self.validate_timestamp(value.timestamp_value)
    elif value.HasField('key_value'):
      self.validate_key(KEY_IN_VALUE, value.key_value)
    elif value.HasField('geo_point_value'):
      if value.meaning != datastore_pbs.MEANING_POINT_WITHOUT_V3_MEANING:
        _assert_condition(abs(value.geo_point_value.latitude) <= 90.0,
                          'Latitude outside permitted range [-90.0, 90.0].')
        _assert_condition(abs(value.geo_point_value.longitude) <= 180.0,
                          'Longitude outside permitted range [-180.0, 180.0].')
    elif value.HasField('entity_value'):
      entity_in_value_constraint = _get_entity_in_value_constraint(constraint)
      self.validate_entity(entity_in_value_constraint, value.entity_value)
    elif value.HasField('array_value'):
      _assert_condition(not value.exclude_from_indexes,
                        ('A Value containing a array_value cannot specify '
                         'exclude_from_indexes.'))
      _assert_condition(not value.meaning,
                        ('A Value containing a array_value cannot specify '
                         'a meaning.'))
      for sub_value in value.array_value.values:
        _assert_condition(not sub_value.HasField('array_value'),
                          ('array_value cannot contain a Value containing '
                           'another array_value.'))
        self.validate_value(constraint, sub_value)
    self.__validate_value_meaning_matches_union(value)
    self.__validate_value_meaning_constraints(constraint, value)
    self.__validate_value_index_constraints(value)
Imitates a user creating and viewing a collection.
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/datastore/cloud_datastore_validator.py/_EntityValidator.validate_value--crossover with--dataset/ETHPy150Open Impactstory/total-impact-core/totalimpact/testers.py/CollectionTester.create