@staticmethod
  def GetFlowRequests(flow_urns, token=None):
    """Returns all outstanding requests for the flows in flow_urns."""
    flow_requests = {}
    flow_request_urns = [flow_urn.Add("state") for flow_urn in flow_urns]

    for flow_urn, values in data_store.DB.MultiResolvePrefix(
        flow_request_urns, "flow:", token=token):
      for subject, serialized, _ in values:
        try:
          if "status" in subject:
            msg = rdf_flows.GrrMessage(serialized)
          else:
            msg = rdf_flows.RequestState(serialized)
        except Exception as e:  # pylint: disable=broad-except
          logging.warn("Error while parsing: %s", e)
          continue

        flow_requests.setdefault(flow_urn, []).append(msg)
    return flow_requests
dataset/ETHPy150Open google/grr/grr/lib/flow.py/GRRFlow.GetFlowRequests/original