preforms an actionm based on a user answer
553353
def handle_ans(self, ans_):
        
        ans = ans_.strip(' ')
        def chack_if_answer_was(valid_keys):
            return any([ans == key or ans.startswith(key + ' ')
                        for key in valid_keys])
        # Custom interactions
        for func, tup in self.actions.items():
            valid_keys = tup[0]
            if chack_if_answer_was(valid_keys):
                func()
13020
def on_created(self, event):
        ''''''
        if self.trigger != "create":
            return
        action_input = ActionInput(event, "", self.name)
        flows.Global.MESSAGE_DISPATCHER.send_message(action_input)
321040
def respond_to?(method_name, _include_all = false)
      if attrs.key?(method_name.to_s)
        true
      else
        super(method_name)
      end
    end
1358431
private void addResponsesToAction(ControllerRouteModel<Raml> elem, Action action) {

        // get all mimeTypes defined in @Route.produces
        LOGGER.debug("responsesMimes.size:"+elem.getResponseMimes().size());
        List<String> mimes = new ArrayList<>();
        mimes.addAll(elem.getResponseMimes());

        // if no mimeTypes defined, no response specifications
        if(mimes.isEmpty()){
            return;
        }

        int i=0;
        // iterate over @response.code javadoc annotation
        for (String code : elem.getResponseCodes()) {
            LOGGER.debug("code:"+code);

            // get mimeType in order of declaration, else get first
            String mime;
            if(mimes.size()>i){
                mime = mimes.get(i);
            } else {
                mime = mimes.get(0);
            }

            Response resp = new Response();

            // add @response.description javadoc annotation if exist
            if(elem.getResponseDescriptions().size()>i){
                resp.setDescription(elem.getResponseDescriptions().get(i));
            }

            // add @response.body javadoc annotation if exist
            if(elem.getResponseBodies().size()>i){
                MimeType mimeType = new MimeType(mime);
                mimeType.setExample(elem.getResponseBodies().get(i).toString());

                resp.setBody(Collections.singletonMap(mime, mimeType));
            }

            action.getResponses().put(code, resp);
            i++;
        }
    }
76234
def allow(cls, action, **kwargs):
        
        return cls.create(action, exclude=False, **kwargs)
928438
def get_action(self, action=None):
        
        if action:
            self.action = action

        if self.action not in AjaxResponseAction.choices:
            raise ValueError(
                "Invalid action selected: '{}'".format(self.action))

        return self.action
883453
def run(self, name, *args):
        """"""
        assert isinstance(name, string_types)
        # Resolve the alias if it is an alias.
        name = self._aliases.get(name, name)
        # Get the action.
        action = self._actions_dict.get(name, None)
        if not action:
            raise ValueError("Action `{}` doesn't exist.".format(name))
        if not name.startswith('_'):
            logger.debug("Execute action `%s`.", name)
        return action.callback(*args)
526797
public function answerAction()
    {
        // Set menu OFF
        $this->menu->setVisible(false);

        $token    = $this->getToken();
        $snippets = $token->getAnswerSnippetNames();

        if ($snippets) {
            $this->setTitle(sprintf($this->_('Token answers: %s'), strtoupper($token->getTokenId())));

            $params = $this->_processParameters($this->answerParameters + $this->defaultTokenParameters);

            $this->addSnippets($snippets, $params);
        }
    }
154914
def execute(self, name):
        
        generator = self._get_generator(name)
        generator.initializing()
        answers = generator.prompting(create_store_prompt(name))
        # TODO
        # app.insight.track('yoyo', 'help', answers)
        generator.configuring(answers)
        generator.writing(answers)
1053120
def Action(act, *args, **kw):
    """"""
    # Really simple: the _do_create_* routines do the heavy lifting.
    _do_create_keywords(args, kw)
    if is_List(act):
        return _do_create_list_action(act, kw)
    return _do_create_action(act, kw)
771610
def doAction(self, loginMethod, actionClass):
        
        loginAccount = loginMethod.account
        return actionClass(
            self,
            loginMethod.localpart + u'@' + loginMethod.domain,
            loginAccount)
116956
function validateAction (action, interactable) {
        if (!isObject(action)) { return null; }

        var actionName = action.name,
            options = interactable.options;

        if ((  (actionName  === 'resize'   && options.resize.enabled )
            || (actionName      === 'drag'     && options.drag.enabled  )
            || (actionName      === 'gesture'  && options.gesture.enabled))
            && actionIsEnabled[actionName]) {

            if (actionName === 'resize' || actionName === 'resizeyx') {
                actionName = 'resizexy';
            }

            return action;
        }
        return null;
    }
993192
def action(self, item, action_type, body={}):
        
        uri = "/%s/%s/action" % (self.uri_base, utils.get_id(item))
        action_body = {action_type: body}
        return self.api.method_post(uri, body=action_body)
534349
function seqActions(actions, seed, onCompleted) {
  var index = 0;

  function invokeNext(v) {
    var action = actions[index];
    action(v, function (res) {
      index = index + 1;
      if (index < actions.length) {
        invokeNext(res);
      } else {
        onCompleted(res);
      }
    });
  }

  invokeNext(seed);
}
1281015
def _handle_actionif(self, _):
        """"""
        obj = _make_object("ActionIf")
        obj.BranchOffset = unpack_si16(self._src)
        yield obj
1042532
def handle_response(self, item_session: ItemSession) -> Actions:
        '''
        '''
        action = self.consult_response_hook(item_session)

        if action == Actions.RETRY:
            item_session.set_status(Status.error)
        elif action == Actions.FINISH:
            item_session.set_status(Status.done)
        elif action == Actions.STOP:
            raise HookStop('Script requested immediate stop.')

        return action
1285640
private function callAction($actionReader, $apiRequest, $action, $args)
    {
        $actionExecutor = new ActionExecutor($actionReader);

        /** @var ActionResponseModel $actionResponse */
        $actionResponse = $actionExecutor->execute($apiRequest, $action, $args);

        $ack = new AckModel();

        $class = '';
        if (is_object($actionResponse->getResponse())) {
            $class = get_class($actionResponse->getResponse());
        }

        $ack
            ->setPkgUuid($actionResponse->getPkgUuid())
            ->setSuccess(true)
            ->setServerCode(200)
            ->setLocation($apiRequest->getPath())
            ->setLocationParams($actionResponse->getParams())
            ->setRequestArgs($actionResponse->getArgs())
            ->setPayloadClass($class)
            ->setPayload($actionResponse->getResponse());

        return $ack;
    }