def validate_entity(self, constraint, entity):
    if entity.HasField('key'):
      self.validate_key(constraint, entity.key)
    else:
      _assert_condition(constraint.absent_key_allowed,
                        'Entity is missing key.')
    for name, value in entity.properties.iteritems():
      self.validate_property_name(constraint, name)
      self.validate_value(constraint, value)
Validates an entity.
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/datastore/cloud_datastore_validator.py/_EntityValidator.validate_entity