def ReadResponses(self, request_list, timestamp=None):
    """Reads responses for multiple requests at the same time.

    Args:
      request_list: The list of requests the responses should be fetched for.
      timestamp: A timestamp as used in the data store.

    Yields:
      tuples (request, lists of fetched responses for the request)
    """

    response_subjects = {}
    for request in request_list:
      response_subject = self.GetFlowResponseSubject(request.session_id,
                                                     request.id)
      response_subjects[response_subject] = request

    response_data = dict(
        self.MultiResolvePrefix(
            response_subjects, self.FLOW_RESPONSE_PREFIX, timestamp=timestamp))

    for response_urn, request in sorted(iteritems(response_subjects)):
      responses = []
      for _, serialized, timestamp in response_data.get(response_urn, []):
        msg = rdf_flows.GrrMessage.FromSerializedString(serialized)
        msg.timestamp = timestamp
        responses.append(msg)

      yield (request, sorted(responses, key=lambda msg: msg.response_id))
def ReadResponses ( self , request_list , timestamp = None ) : response_subjects = { } for request in request_list : response_subject = self . GetFlowResponseSubject ( request . session_id , request . id ) response_subjects [ response_subject ] = request response_data = dict ( self . MultiResolvePrefix ( response_subjects , self . FLOW_RESPONSE_PREFIX , timestamp = timestamp ) ) for response_urn , request in sorted ( iteritems ( response_subjects ) ) : responses = [ ] for _ , serialized , timestamp in response_data . get ( response_urn , [ ] ) : msg = rdf_flows . GrrMessage . FromSerializedString ( serialized ) msg . timestamp = timestamp responses . append ( msg ) yield ( request , sorted ( responses , key = lambda msg : msg . response_id ) )
Reads responses for multiple requests at the same time.

    Args:
      request_list: The list of requests the responses should be fetched for.
      timestamp: A timestamp as used in the data store.

    Yields:
      tuples (request, lists of fetched responses for the request)