def Transform(self, client, photo, callback):
    from viewfinder.backend.storage.s3_object_store import S3ObjectStore

    def _SetPhotoMD5Values(md5_values):
      tn_md5, med_md5, full_md5, orig_md5 = md5_values

      assert photo.tn_md5 == tn_md5 or photo.tn_md5 is None, photo
      photo.tn_md5 = tn_md5

      assert photo.med_md5 == med_md5 or photo.med_md5 is None, photo
      photo.med_md5 = med_md5

      assert photo.full_md5 == full_md5 or photo.full_md5 is None, photo
      photo.full_md5 = full_md5

      assert photo.orig_md5 == orig_md5 or photo.orig_md5 is None, photo
      photo.orig_md5 = orig_md5

      photo.placemark = photo.placemark

      self._LogUpdate(photo)

      if Version._mutate_items:
        photo.Update(client, partial(callback, photo))
      else:
        callback(photo)

    def _OnFetchHead(head_callback, response):
      # Etag is the hex string encoded MD5 hash of the photo.
      if response.code != 404:
        etag = response.headers['Etag'][1:-1]
      else:
        etag = None
      head_callback(etag)

    def _SendHeadRequest(photo_id, suffix, head_callback):
      object_store = S3ObjectStore('photos-viewfinder-co')
      url = object_store.GenerateUrl(photo_id + suffix, method='HEAD')
      http_client = httpclient.AsyncHTTPClient()
      http_client.fetch(url, method='HEAD', callback=partial(_OnFetchHead, head_callback))

    client_data = photo.client_data
    if client_data is None or client_data not in 'tn_md5':
      if not Version._allow_s3_queries:
        callback(photo)
        return
      # Get MD5 values by issuing HEAD against S3.
      with util.ArrayBarrier(_SetPhotoMD5Values) as b:
        _SendHeadRequest(photo.photo_id, '.t', b.Callback())
        _SendHeadRequest(photo.photo_id, '.m', b.Callback())
        _SendHeadRequest(photo.photo_id, '.f', b.Callback())
        _SendHeadRequest(photo.photo_id, '.o', b.Callback())
    else:
      # Get MD5 values by extracting from client_data.
      _SetPhotoMD5Values((client_data['tn_md5'], client_data['med_md5'],
                          photo.full_md5, photo.orig_md5))
dataset/ETHPy150Open viewfinderco/viewfinder/backend/db/versions.py/CreateMD5Hashes.Transform/swapped operands of `not in`