def CallClient(self, client_id, action_name, request=None,
                 response_session_id=None, **kwargs):
    """Calls a client action from a well known flow."""

    if client_id is None:
      raise FlowError("CallClient needs a valid client_id.")

    client_id = rdf_client.ClientURN(client_id)

    # Retrieve the correct rdfvalue to use for this client action.
    try:
      action = actions.ActionPlugin.classes[action_name]
    except KeyError:
      raise RuntimeError(action_name % "Client action %s not found.")

    if action.in_rdfvalue is None:
      if request:
        raise RuntimeError("Client action %s does not expect args." %
                           action_name)
    else:
      if request is None:
        # Create a new rdf request.
        request = action.in_rdfvalue(**kwargs)
      else:
        # Verify that the request type matches the client action requirements.
        if not isinstance(request, action.in_rdfvalue):
          raise RuntimeError("Client action expected %s but got %s" % (
              action.in_rdfvalue, type(request)))

    if response_session_id is None:
      cls = GRRFlow.classes["IgnoreResponses"]
      response_session_id = cls.well_known_session_id

    msg = rdf_flows.GrrMessage(
        session_id=utils.SmartUnicode(response_session_id),
        name=action_name, request_id=0, queue=client_id.Queue(),
        payload=request)

    queue_manager.QueueManager(token=self.token).Schedule(msg)
dataset/ETHPy150Open google/grr/grr/lib/flow.py/WellKnownFlow.CallClient/swapped operands of `%`