'Returns notifications for all shards of a queue at once.
Used by worker_test_lib.MockWorker to cover all shards with a single worker.
Args:
queue: usually rdfvalue.RDFURN("aff4:/W")
Returns:
List of rdf_flows.GrrNotification objects'

def GetNotificationsForAllShards(self, queue):

    notifications_by_session_id = {}
    for queue_shard in self.GetAllNotificationShards(queue):
        self._GetUnsortedNotifications(queue_shard, notifications_by_session_id=notifications_by_session_id)
    notifications = notifications_by_session_id.values()
    notifications.sort(key=(lambda notification: notification.priority), reverse=True)
    return notifications
