def _validate_predefined_entity_value(self, entity, entity_name,
                                        allowed_property_map,
                                        required_properties):
    _assert_condition(not entity.HasField('key'),
                      'The %s entity has a key.' % entity_name)
    property_map = {}
    for property_name, value in entity.properties.iteritems():
      _assert_condition(property_name in allowed_property_map,
                        'The %s entity property "%s" is not allowed.'
                        % (entity_name, property_name))
      value = entity.properties[property_name]
      hasser = 'hasField(\'%s_value\')' % allowed_property_map[property_name]
      _assert_condition(
          value.HasField('%s_value' % allowed_property_map[property_name]),
          ('The %s entity property "%s" is the wrong type.'
           % (entity_name, property_name)))
      _assert_condition(not value.meaning,
                        'The %s entity property "%s" has a meaning.'
                        % (entity_name, property_name))
      _assert_condition(value.exclude_from_indexes,
                        'The %s entity property "%s" is indexed.'
                        % (entity_name, property_name))
      property_map[property_name] = value
    for required_property_name in required_properties:
      _assert_condition(required_property_name in property_map,
                        'The %s entity is missing required property "%s".'
                        % (entity_name, required_property_name))
    return property_map
Validates a predefined entity (e.g. a user or a point).
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/datastore/cloud_datastore_validator.py/_EntityValidator._validate_predefined_entity_value