helper method for sending actions
763094
def send_action(action, params=None):
	
	data={"msg_type":"action", "action":action}
	if params is not None:
		data['params']=params
	_comm.send(data)
101151
public void sendEvent(final Map<String, String> params) {
        executor.execute(new Runnable() {
            @Override
            public void run() {
                // put user id
                params.put("cid", userId);
                Multimap queryParams = HashMultimap.create();
                for (Map.Entry<String, String> entry : params.entrySet()) {
                    String key = entry.getKey();
                    String value = entry.getValue();
                    Preconditions.checkNotNull(key, "Custom search param key must not be null.");
                    Preconditions.checkNotNull(value, "Custom search param value must not be null.");
                    queryParams.put(key, value);
                }
                viSearchHttpClient.get(ENDPOINT_SEND_ACTIONS, queryParams);
            }
        });
    }
183649
def post(action, params=None, version=6):
        
        if params is None:
            params = dict()
        to_send = {
            'action': action,
            'version': version,
            'params': params
        }

        r = requests.post(AnkiConnect.URL, json=to_send)
        return r.json()
513223
private void sendAction(Context context, String action) {
        Intent intent = new Intent(context, PlaybackService.class);
        intent.setAction(action);
        LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
    }
411647
def _send_event_to_all(self, action, event):
        
        for project_listeners in self._listeners.values():
            for listener in project_listeners:
                listener.put_nowait((action, event, {}))
862556
def _add_action(self, action):
        
        kwargs = self._get_method_params()

        kwargs['action'] = action

        self._bulk_actions.append(kwargs)
954484
def actions(options = {})
      actions = Action.from_response client.get("#{request_prefix}/actions", { filter: :all }.merge(options))
      MultiAssociation.new(self, actions).proxy
    end
881406
def execute
      return Strings.no_help_commands if @actions.empty?
      actions = @actions.map do |action|
        if action.description.to_s.empty?
          action.name
        else
          "#{action.name} # #{action.description}"
        end
      end
      Strings.help(actions.join("\n"))
    end
630102
public void act(ActionExec action, List<ActionExec> feedback) {
        if (!isRunning())
            return;
        if (this.getSimulation() == null)
            return;

        boolean result = false;

        Structure actionStructure = action.getActionTerm();
        String actionID = actionStructure.getFunctor();

        try {
            if (this.actions.containsKey(actionID)) {

                Constructor<? extends JasonShanksAgentAction> c = this.actions
                        .get(actionID).getConstructor(
                                new Class[] { String.class, Steppable.class });

                JasonShanksAgentAction shanksAction = c.newInstance(
                        this.getID(), this, this.getLogger());

                result = shanksAction.executeAction(this.getSimulation(), this,
                        actionStructure.getTerms());
            } else {
                throw new UnknownShanksAgentActionException(actionID,
                        this.getID());
            }

        } catch (UnknownShanksAgentActionException e) {
            logger.severe("Action was not executed -> " + e.getMessage());
            e.printStackTrace();
        } catch (InstantiationException e) {
            logger.severe("InstantiationException" + e.getMessage());
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            logger.severe("IllegalAccessException" + e.getMessage());
            e.printStackTrace();
        } catch (SecurityException e) {
            logger.severe("SecurityException" + e.getMessage());
            e.printStackTrace();
        } catch (NoSuchMethodException e) {
            logger.severe("NoSuchMethodException" + e.getMessage());
            e.printStackTrace();
        } catch (IllegalArgumentException e) {
            logger.severe("IllegalArgumentException" + e.getMessage());
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            logger.severe("InvocationTargetException" + e.getMessage());
            e.printStackTrace();
        }

        action.setResult(result);
        this.getTS().getC().addFeedbackAction(action);
    }
225538
function(action, method, sysImports, options, channel, req, res) {
    var self = this;

    if (this.actions[action] && (this.actions[action].rpc || 'invoke' === method)) {
      if ('invoke' === method) {
        var imports = (req.method === 'GET' ? req.query : req.body);

        // @todo add files support
        this.actions[action].invoke(imports, channel, sysImports, [], function(err, exports) {
          if (err) {
            self.log(err, channel, 'error');
          }

          res.contentType(DEFS.CONTENTTYPE_JSON);
          if (err) {
            res.send(err, 500);
          } else {
            res.send(exports);
          }
        });
      } else {
        this.actions[action].rpc(method, sysImports, options, channel, req, res);
      }
    } else {
      res.send(404);
    }
  }
254774
function Action(name) {
    Action.super_.call(this);
    this.id = ActionUniqueId();
    this.set('ActionID', this.id);
    this.set('Action', name);
}
1025572
def call_action(matches)
      @action.arity > 0 ? @action.call(matches) : @action.call
    rescue => ex
      UI.error "Problem with watch action!\n#{ex.message}"
      UI.error ex.backtrace.join("\n")
    end
587908
def SetAction(self, action, **kws):
        ""
        if hasattr(action,'__call__'):
            self.__action = Closure(action, **kws)
1132268
public static void sendAction(ActionType action, MalisisSlot slot, int code)
	{
		if (action == null || current() == null || current().inventoryContainer == null)
			return;

		int inventoryId = slot != null ? slot.getInventoryId() : 0;
		int slotNumber = slot != null ? slot.getSlotIndex() : 0;

		current().inventoryContainer.handleAction(action, inventoryId, slotNumber, code);
		InventoryActionMessage.sendAction(action, inventoryId, slotNumber, code);
	}
27106
def _send_event_to_project(self, project_id, action, event):
        
        try:
            project_listeners = self._listeners[project_id]
        except KeyError:
            return
        for listener in project_listeners:
            listener.put_nowait((action, event, {}))
652959
@Override
    public void actionDialog() throws JspException, ServletException, IOException {

        if (getAction() == ACTION_CONTINUE) {
            sendForward(nextUrl(), paramsAsParameterMap());
            return;
        }
        super.actionDialog();
    }
1036185
public ApiResponse<MessageIDEnvelope> sendActionsWithHttpInfo(Actions data) throws ApiException {
        com.squareup.okhttp.Call call = sendActionsValidateBeforeCall(data, null, null);
        Type localVarReturnType = new TypeToken<MessageIDEnvelope>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }