@classmethod
  def PushNotification(cls, client, user_id, alert, badge, callback,
                       exclude_device_id=None, extra=None, sound=None):
    def _OnQuery(devices):
      with util.Barrier(callback) as b:
        now = util.GetCurrentTimestamp()
        for device in devices:
          if device.device_id != exclude_device_id:
            token = device.push_token
            assert token, device
            try:
              PushNotification.Push(token, alert=alert, badge=badge, sound=sound, extra=extra)
            except TypeError as e:
              logging.error('bad push token %s', token)
              Device._HandleBadPushToken(client, token, time.time(), b.Callback())
            except Exception as e:
              logging.warning('failed to push notification to user %d: %s', user_id, e)
              raise

    # Find all devices owned by the user that need to be alerted.
    Device.QueryAlertable(client, user_id, _OnQuery)
Reading from request is allowed after accessing request contents as
dataset/ETHPy150Open viewfinderco/viewfinder/backend/db/device.py/Device.PushNotification--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.3/tests/regressiontests/requests/tests.py/RequestsTests.test_read_after_value