Choose an action to perform

        # Returns
            Action to take (int)
178747
def select_action(self, **kwargs):
        
        setattr(self.inner_policy, self.attr, self.get_current_value())
        return self.inner_policy.select_action(**kwargs)
582985
def call_action(input)
      @action.respond_to?(:call) ? @action.call(input) : Rc.send(@action, input)
    rescue StandardError, SyntaxError
      message = $!.is_a?(NoMethodError) && !@action.respond_to?(:call) &&
        !Rc.respond_to?(@action) ? "Completion action '#{@action}' doesn't exist." :
        "Failed during completion action '#{name}' with '#{$!.message}'."
      raise FailedMissionError.new(self), message
    end
54016
def performAction(self, action):
        
        self._lastAction = []

        # Markups chosen for each generator.
        actions = self._allActions[action]

        n = self.numOffbids * len(self.generators)
        markups = actions[:n]
        withholds = actions[n:]

#        print "ALL ACTIONS:", self._allActions
#        print "ACTIONS:", markups, withholds

        self._offbid(markups, withholds)
402853
def get(self, action, default=None):
        

        try:
            return self.__getitem__(action)
        except KeyError as error:
            return default
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)
76234
def allow(cls, action, **kwargs):
        
        return cls.create(action, exclude=False, **kwargs)
1127091
def succeed(self, instance, action):
        
        uid = api.get_uid(instance)
        return self.objects.get(uid, {}).get(action, {}).get('success', False)
1270447
def act(self, action):
        
        # FIXME: Hack to change in return type
        action = int(action)
        assert isinstance(action, int)
        assert action < self.actions_num, "%r (%s) invalid"%(action, type(action))

        # Reset buttons
        for k in self.world_layer.buttons:
            self.world_layer.buttons[k] = 0

        # Apply each button defined in action config
        for key in self.world_layer.player.controls[action]:
            if key in self.world_layer.buttons:
                self.world_layer.buttons[key] = 1

        # Act in the environment
        self.step()

        observation = self.world_layer.get_state()
        reward = self.world_layer.player.get_reward()
        terminal = self.world_layer.player.game_over
        info = {}

        return observation, reward, terminal, info
530047
function(o, f, c, proto, action) {
            if (o && o[action] && o !== Y) {
                return o[action].call(o, f, c);
            } else {
                switch (A.test(o)) {
                    case 1:
                        return A[action](o, f, c);
                    case 2:
                        return A[action](Y.Array(o, 0, true), f, c);
                    default:
                        return Y.Object[action](o, f, c, proto);
                }
            }
        }
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)
512848
def do_action(self, action, objects):
        
        transitioned = []
        ActionHandlerPool.get_instance().queue_pool()
        for obj in objects:
            obj = api.get_object(obj)
            success, message = do_action_for(obj, action)
            if success:
                transitioned.append(obj)
        ActionHandlerPool.get_instance().resume()
        return transitioned
1047571
def indexOf(self, action):
        
        for i, act in enumerate(self.actionGroup().actions()):
            if action in (act, act.objectName(), act.text()):
                return i
        return -1
740607
def select_action(self, q_values):
        
        assert q_values.ndim == 1
        action = np.argmax(q_values)
        return action
230246
def action_get(method_name):
    

    def action_get(_value, context, **_params):
        method = getattr(context["action"], method_name)
        return _get(method, context["key"], (), {})

    return action_get
1353573
private ParsingState.Action getAction(int l, int r, int[] heads) {
		if (heads[l] == r && modifierNumOf(l, heads) == 0)
			return ParsingState.Action.RIGHT;
		if (heads[r] == l && modifierNumOf(r, heads) == 0)
			return ParsingState.Action.LEFT;
		return ParsingState.Action.SHIFT;
	}
798374
def execute_action action, silence=false
      action = action.strip
      if wait_for_prompt
        stdout.puts(action) unless silence
        @prompted = false
        process_runner.puts action
      end
    end
1000282
def pick_action_todo():
    
    for ndx, todo in enumerate(things_to_do):
        #print('todo = ', todo)
        if roll_dice(todo["chance"]):
            cur_act = actions[get_action_by_name(todo["name"])]
            if todo["WHERE_COL"] == "energy" and my_char["energy"] > todo["WHERE_VAL"]:
                return cur_act
            if todo["WHERE_COL"] == "gold" and my_char["gold"] > todo["WHERE_VAL"]:
                return cur_act


    return actions[3]