Applies an action to the selected country states
492906
protected function actionListCountryState()
    {
        list($selected, $action, $value) = $this->getPostedAction();

        $deleted = $updated = 0;

        foreach ($selected as $id) {

            if ($action === 'status' && $this->access('state_edit')) {
                $updated += (int) $this->state->update($id, array('status' => $value));
            }

            if ($action === 'delete' && $this->access('state_delete')) {
                $deleted += (int) $this->state->delete($id);
            }
        }

        if ($updated > 0) {
            $text = $this->text('Updated %num item(s)', array('%num' => $updated));
            $this->setMessage($text, 'success');
        }

        if ($deleted > 0) {
            $text = $this->text('Deleted %num item(s)', array('%num' => $deleted));
            $this->setMessage($text, 'success');
        }
    }
406323
function action() {
    var self = Thng.resourceConstructor.call(this, this.id);
    return self.action.apply(self, arguments);
  }
95956
def actions(self, state):
        ''''''
        rows = string_to_list(state)
        row_e, col_e = find_location(rows, 'e')

        actions = []
        if row_e > 0:
            actions.append(rows[row_e - 1][col_e])
        if row_e < 2:
            actions.append(rows[row_e + 1][col_e])
        if col_e > 0:
            actions.append(rows[row_e][col_e - 1])
        if col_e < 2:
            actions.append(rows[row_e][col_e + 1])

        return actions
1270640
@Override
    public boolean applyAction(Model m) {
        Mapping map = m.getMapping();
        return map.isRunning(vm) &&
                map.getVMLocation(vm).equals(src) &&
                map.addSleepingVM(vm, dst);
    }
262965
def register_actions(self, shortcut_manager):
        
        shortcut_manager.add_callback_for_action('rename', self.rename_selected_state)
        super(StatesEditorController, self).register_actions(shortcut_manager)
8436
function doaction(type, data) {
		if (gui.hosted) {
			gui.Action.ascendGlobal(document, type, data);
		}
	}
168438
function setStateAndCountry(&$info) {
    global $db, $messageStack;
    switch ($info['country']['iso_code_2']) {
      case 'AU':
      case 'US':
      case 'CA':
      // Paypal only accepts two character state/province codes for some countries.
      if (strlen($info['state']) > 2) {
        $sql = "SELECT zone_code FROM " . TABLE_ZONES . " WHERE zone_name = :zoneName";
        $sql = $db->bindVars($sql, ':zoneName', $info['state'], 'string');
        $state = $db->Execute($sql);
        if (!$state->EOF) {
          $info['state'] = $state->fields['zone_code'];
        } else {
          $messageStack->add_session('header', MODULE_PAYMENT_PAYPALDP_TEXT_STATE_ERROR, 'error');
        }
      }
      break;
      case 'AT':
      case 'BE':
      case 'FR':
      case 'DE':
      case 'CH':
      $info['state'] = '';
      break;
      case 'GB':
      break;
      default:
      $info['state'] = '';
    }
  }
860842
private void updateRegion() {
		actMessage.setVisible(false);

		String state = (String) stateSelector.getSelected();

		if (STATE_ACT.equals(state)) {
			actMessage.setVisible(true);
			regionSelector.setOptions(new String[]{null, "Belconnen", "City", "Woden"});
		} else if (STATE_NSW.equals(state)) {
			regionSelector.setOptions(
					new String[]{null, "Hunter", "Riverina", "Southern Tablelands"});
		} else if (STATE_VIC.equals(state)) {
			regionSelector.setOptions(
					new String[]{null, "Gippsland", "Melbourne", "Mornington Peninsula"});
		} else {
			regionSelector.setOptions(new Object[]{null});
		}
	}
633821
def _apply_param_actions(self, params, schema_params):
        """"""

        for key, val in schema_params.items():
            if key not in params:
                continue

            if isinstance(val, dict):
                self._apply_param_actions(params[key], schema_params[key])
            elif isinstance(val, ResourceId):
                resource_id = val

                # Callers can provide ints as ids.
                # We normalize them to strings so that actions don't get confused.
                params[key] = str(params[key])

                resource_id.action(params, schema_params, key,
                                   resource_id, self.state, self.options)
            else:
                logger.error("Invalid value in schema params: %r. schema_params: %r and params: %r",
                             val, schema_params, params)
895219
def select_action(self, nb_actions, probs):
        
        action = np.random.choice(range(nb_actions), p=probs)
        return action
901918
protected function deleteCountryState()
    {
        $this->controlAccess('state_delete');

        if ($this->state->delete($this->data_state['state_id'])) {
            $url = "admin/settings/states/{$this->data_country['code']}";
            $this->redirect($url, $this->text('Country state has been deleted'), 'success');
        }

        $this->redirect('', $this->text('Country state has not been deleted'), 'warning');
    }
34980
def country_select(method, options = {}, html_options = {}, additional_country = nil)
      @countries ||= (additional_country ? [additional_country] : []) + Country.find(:all, :order => 'sort, name asc')
      self.menu_select(method, I18n.t('muck.engine.choose_country'), @countries, options.merge(:prompt => I18n.t('muck.engine.select_country_prompt'), :wrapper_id => 'countries-container'), html_options.merge(:id => 'countries'))
    end
1275077
function doAction() {
            var now = (new Date()).getTime();
            var diff = now - lastTapTime;
            var isDiffElemSafeDelay = elem !== lastElemTapped && diff > 200;
            var isSameElemSafeDelay = elem === lastElemTapped && diff > sameElemSafeDelay;

            if (tapped && (isDiffElemSafeDelay || isSameElemSafeDelay)) {
                lastElemTapped = elem;
                lastTapTime = now;
                safeApply(action, scope);
            }

            // reset tapped at end
            tapped = false;
        }
454787
protected function updateCountryState()
    {
        $this->controlAccess('state_edit');

        if ($this->state->update($this->data_state['state_id'], $this->getSubmitted())) {
            $url = "admin/settings/states/{$this->data_country['code']}";
            $this->redirect($url, $this->text('Country state has been updated'), 'success');
        }

        $this->redirect('', $this->text('Country state has not been updated'), 'warning');
    }
320185
@Override
    public boolean applyAction(Model c) {
        Mapping map = c.getMapping();
        return !map.isOffline(node) && map.addOfflineNode(node);
    }
1121041
public function cmdUpdateCountry()
    {
        $params = $this->getParam();

        if (empty($params[0]) || count($params) < 2) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        $this->setSubmitted(null, $params);
        $this->setSubmitted('update', $params[0]);
        $this->setSubmittedJson('format');
        $this->validateComponent('country');

        $this->updateCountry($params[0]);
        $this->output();
    }
352693
def act(self, action):
    """"""
    if action and action.ListFields():  # Skip no-ops.
      return self.actions(sc_pb.RequestAction(actions=[action]))