Choose the action space for the action proto.
352201
def spatial(action, action_space):
  """"""
  if action_space == ActionSpace.FEATURES:
    return action.action_feature_layer
  elif action_space == ActionSpace.RGB:
    return action.action_render
  else:
    raise ValueError("Unexpected value for action_space: %s" % action_space)
195430
def build_action(self, action):
        
        try:
            self.action = Action.from_string(action)
        except ValueError:
            raise

        return self
406323
function action() {
    var self = Thng.resourceConstructor.call(this, this.id);
    return self.action.apply(self, arguments);
  }
899013
function (jax) {
      var SRE = jax.root.SRE, actions = SRE.action, j, state = {};
      SRE.width = jax.sreGetRootWidth(state);
      for (j = actions.length-1; j >= 0; j--) actions[j].selection = 2;
      for (j = actions.length-1; j >= 0; j--) {
        var action = actions[j];
        if (action.SREwidth == null) {
          action.selection = 1;
          action.SREwidth = jax.sreGetActionWidth(state,action);
        }
      }
      SRE.actionWidths = true;
    }
51661
def select_warp_gates(action, action_space, select_add):
  """"""
  del action_space
  action.action_ui.select_warp_gates.selection_add = select_add
1041164
def build_action(self, runnable, regime, action):
        

        if isinstance(action, StateAssignment):
            return self.build_state_assignment(runnable, regime, action)
        if isinstance(action, EventOut):
            return self.build_event_out(action)
        if isinstance(action, Transition):
            return self.build_transition(action)
        else:
            return ['pass']
102771
def action(self, target, message, formatted=True, tags=None):
        """"""
        if formatted:
            message = unescape(message)

        self.ctcp(target, 'ACTION', message)
918609
def apply_action action, street
      # puts "pfr: apply_action #{street}, #{action.inspect}"
      result = action[:result]
      player = action[:screen_name]
      if street == :preflop and [:pay, :pay_to, :neutral].member?(result) and @pfr_opportunity[player].nil?
        case result
        when :pay, :neutral
          @pfr_opportunity[player] = true
          @pfr_opportunity_taken[player] = false
        when :pay_to
          @hand_statistics.players.each {|each_player| @pfr_opportunity[each_player] ||= (each_player == player)}
          @pfr_opportunity_taken[player] = true
        end
      end
    end
591239
def cmd_minimap(action, action_space, ability_id, queued, minimap):
  """"""
  action_cmd = spatial(action, action_space).unit_command
  action_cmd.ability_id = ability_id
  action_cmd.queue_command = queued
  minimap.assign_to(action_cmd.target_minimap_coord)
85723
def _setup(self, action, line):
        ''' 
        '''
        bot.debug('[in]  %s' % line)

        # Replace ACTION at beginning
        line = re.sub('^%s' % action, '', line)

        # Handle continuation lines without ACTION by padding with leading space
        line = " " + line

        # Split into components
        return [x for x in self._split_line(line) if x not in ['', None]]
273690
def _set_selected_action(self, action):
        """"""
        assert action in self._action_sets

        if self._selected_action is not None:
            raise ValueError("The action has already been selected.")
        self._selected_action = action
1269003
def select_action(self, state):
    
    value = 0
    if self.steps < self.min_steps:
      action = np.random.randint(self.actions)
    else:
      self.eps = max(self.eps_end, self.eps * self.eps_decay)
      if random.random() < self.eps:
        action = np.random.randint(self.actions)
      else:
        self.local.eval()
        with torch.no_grad():
          state = torch.tensor(state, device=self.device, dtype=torch.float).unsqueeze(0)
          Q = self.local(state)
          value, action = torch.max(Q, 1)

    return int(action), float(value)
560368
def action_size(self) -> Sequence[Shape]:
        ''''''
        return self._sizes(self._compiler.rddl.action_size)
849857
def run(self, f, *args, **kwargs):
        
        parent = _ACTION_CONTEXT.set(self)
        try:
            return f(*args, **kwargs)
        finally:
            _ACTION_CONTEXT.reset(parent)
523359
def select_rect(action, action_space, select_add, screen, screen2):
  """"""
  select = spatial(action, action_space).unit_selection_rect
  out_rect = select.selection_screen_coord.add()
  screen_rect = point.Rect(screen, screen2)
  screen_rect.tl.assign_to(out_rect.p0)
  screen_rect.br.assign_to(out_rect.p1)
  select.selection_add = bool(select_add)
1241393
def select_idle_worker(action, action_space, select_worker):
  """"""
  del action_space
  action.action_ui.select_idle_worker.type = select_worker
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;
    }