'Returns all queue notifications sorted by priority.'

def GetNotifications(self, queue):

    queue_shard = self.GetNotificationShard(queue)
    notifications = self._GetUnsortedNotifications(queue_shard).values()
    notifications.sort(key=(lambda notification: notification.priority), reverse=True)
    return notifications
