@classmethod
  @gen.coroutine
  def CheckCreate(cls, client, **ph_dict):
    assert 'photo_id' in ph_dict and 'user_id' in ph_dict, ph_dict
    photo = yield Photo.Query(client, ph_dict['photo_id'], None, must_exist=False)
    # All attributes should match between the ph_dict and persisted photo metadata
    # (except those allowed to be different).
    if photo is not None and \
        photo.HasMismatchedValues(Photo.PHOTO_CREATE_ATTRIBUTE_UPDATE_ALLOWED_SET, **ph_dict):
      logging.warning('Photo.CheckCreate: keyword mismatch failure: %s, %s' % (photo, ph_dict))
      raise InvalidRequestError('There is a mismatch between request and persisted photo metadata during photo '
                                  'metadata creation.')
    raise gen.Return(photo)
For a photo that already exists, check that its attributes match.
dataset/ETHPy150Open viewfinderco/viewfinder/backend/db/photo.py/Photo.CheckCreate