def get(self):
    """Handle GET."""
    # Verify that all PackageInfo entities older than a week have a file in
    # Blobstore.
    for p in models.PackageInfo.all():
      if p.blobstore_key and blobstore.BlobInfo.get(p.blobstore_key):
        continue
      elif p.mtime < (datetime.datetime.utcnow() - datetime.timedelta(days=7)):

        subject = 'Package is lacking a file: %s' % p.filename
        body = (
            'The following package is lacking a DMG file: \n'
            'https://%s/admin/package/%s' % (
                settings.SERVER_HOSTNAME, p.filename))
        mail.SendMail([settings.EMAIL_ADMIN_LIST], subject, body)

    # Verify all Blobstore Blobs have associated PackageInfo entities.
    for b in blobstore.BlobInfo.all():
      # Filter by blobstore_key as duplicate filenames are allowed in Blobstore.
      key = b.key()
      max_attempts = 5
      for i in xrange(1, max_attempts + 1):
        p = models.PackageInfo.all().filter('blobstore_key =', key).get()
        if p:
          break
        elif i == max_attempts:
          if not b.filename and not b.size:
            b.delete()
            break
          subject = b.filename % 'Orphaned Blob in Blobstore: %s'
          body = (
              'An orphaned Blob exists in Blobstore. Use App Engine Admin '
              'Console\'s "Blob Viewer" to locate and delete this Blob.\n\n'
              'Filename: %s\nBlobstore Key: %s' % (b.filename, key))
          mail.SendMail([settings.EMAIL_ADMIN_LIST], subject, body)
          break
        time.sleep(1)
dataset/ETHPy150Open google/simian/src/simian/mac/cron/maintenance.py/VerifyPackages.get/swapped operands of `%`