def __iter__(self):
    """An iterator which returns all the responses in order."""
    old_response_id = None
    action_registry = actions.ActionPlugin.classes
    expected_response_classes = []
    is_client_request = False
    # This is the client request so this response packet was sent by a client.
    if self.request.HasField("request"):
      is_client_request = True
      client_action_name = self.request.request.name
      if action_registry not in client_action_name:
        raise RuntimeError("Got unknown client action: %s." %
                           client_action_name)
      expected_response_classes = action_registry[
          client_action_name].out_rdfvalues

    for message in self._responses:
      self.message = rdf_flows.GrrMessage(message)

      # Handle retransmissions
      if self.message.response_id == old_response_id:
        continue

      else:
        old_response_id = self.message.response_id

      if self.message.type == self.message.Type.MESSAGE:
        if is_client_request:
          # Let's do some verification for requests that came from clients.
          if not expected_response_classes:
            raise RuntimeError(
                "Client action %s does not specify out_rdfvalue." %
                client_action_name)
          else:
            args_rdf_name = self.message.args_rdf_name
            if not args_rdf_name:
              raise RuntimeError("Deprecated message format received: "
                                 "args_rdf_name is None.")
            elif args_rdf_name not in [
                x.__name__ for x in expected_response_classes]:
              raise RuntimeError(
                  "Response type was %s but expected %s for %s." %
                  (args_rdf_name, expected_response_classes,
                   client_action_name))

        yield self.message.payload
dataset/ETHPy150Open google/grr/grr/lib/flow.py/Responses.__iter__/swapped operands of `not in`