def get(self):
    """Handle GET."""
    pkgs, unused_dt = models.ReportsCache.GetInstallCounts()

    for p in models.PackageInfo.all():
      if not p.plist:
        continue  # skip over pkginfos without plists.

      if p.munki_name not in pkgs:
        # Skip pkginfos that ReportsCache lacks.
        continue
      elif not pkgs[p.munki_name].get('duration_seconds_avg', None):
        # Skip pkginfos where there is no known average duration.
        continue

      # Obtain a lock on the PackageInfo entity for this package, or skip.
      lock = 'pkgsinfo_%s' % p.filename
      if not gae_util.ObtainLock(lock, timeout=5.0):
        continue  # Skip; it'll get updated next time around.

      # Append the avg duration text to the description; in the future the
      # avg duration time and overall install count will be added to they're
      # own pkginfo keys so the information can be displayed independantly.
      # This requires MSU changes to read and display such values, so for now
      # simply append text to the description.
      old_desc = p.plist['description']
      avg_duration_text = models.PackageInfo.AVG_DURATION_TEXT % (
          pkgs[p.munki_name]['duration_count'],
          pkgs[p.munki_name]['duration_seconds_avg'])
      p.description = '%s\n\n%s' % (p.description, avg_duration_text)
      if p.plist['description'] != old_desc:
        p.put()  # Only bother putting the entity if the description changed.
      gae_util.ReleaseLock(lock)

    # Asyncronously regenerate all Catalogs to include updated pkginfo plists.
    delay = 0
    for track in common.TRACKS:
      delay += 5
      models.Catalog.Generate(track, delay=delay)
dataset/ETHPy150Open google/simian/src/simian/mac/cron/maintenance.py/UpdateAverageInstallDurations.get/original