Verifies the given action is a valid duplicate jar rule action.

    :returns: The action if it is valid.
    :raises: ``ValueError`` if the action is invalid.
507259
def validate_action(cls, action):
    
    if action not in cls._VALID_ACTIONS:
      raise ValueError('The supplied action must be one of {valid}, given: {given}'
                       .format(valid=cls._VALID_ACTIONS, given=action))
    return action
559211
public final ResourceException isValid(int newAction) {
        try {
            setState(newAction, true);
        } catch (TransactionException exp) {
            FFDCFilter.processException(exp, "com.ibm.ws.rsadapter.spi.WSStateManager.isValid", "385", this);
            return exp;
        }

        return null;
    }
303559
def do_actions(self, target_filename, dry_run=False):
        
        for rule in self.action_rules:
            target_filename = rule.do_action(target_filename, dry_run)

        raise StopProcessingException
1105576
def is_required(action):
  ''' '''
  return not action.option_strings and not isinstance(action, _SubParsersAction) or action.required == True
894940
function isActionsExistsInPermissionActions(allActions, schemaActions) {
    return utils.contains(allActions.sort().join(), schemaActions.sort().join());
}
45766
def _check_action(action):
    """"""
    if isinstance(action, types.StringTypes):
        action = action.lower()

    if action not in ['learn', 'forget', 'report', 'revoke']:
        raise SpamCError('The action option is invalid')
    return action
192742
def is_upload(action):
    
    return 'r' in action.type._mode and (action.default is None or
                                         getattr(action.default, 'name') not in (sys.stderr.name, sys.stdout.name))
22117
def validate_object_action(self, action_name, obj=None):
        
        action_method = getattr(self, action_name)
        if not getattr(action_method, 'detail', False) and action_name not in ('update', 'partial_update', 'destroy'):
            # DRF does not add flag 'detail' to update and delete actions, however they execute operation with
            # particular object. We need to enable validation for them too.
            return
        validators = getattr(self, action_name + '_validators', [])
        for validator in validators:
            validator(obj or self.get_object())
89926
def _action_allowed(self, action):
    
    if getattr(self.layer.participation_settings, '{0}_allowed'.format(action)) is False:
        return False
    else:
        return getattr(self.participation_settings, '{0}_allowed'.format(action))
313664
function isValidAction(actionString) {
	return module.exports.actions.some(foundAction => {
		return foundAction.match.test(actionString);
	});
}
957889
def is_valid(self):
        
        return super(SimpleDependency, self).is_valid() or (
            self.requirement.immediate_rebind and self._pending_ref is not None
        )
1093067
private static void checkActionsInCommon(Actioner actioner, Collection<ActionRef> actions)
    {
        if (actions.isEmpty())
        {
            actions.addAll(actioner.getActions());
        }
        else
        {
            actions.retainAll(actioner.getActions());
        }
    }
183689
def check(action, recalculate: false)
      return false if adapter.rate_limited?(action.scope, action.identifier) && !recalculate
      timestamp = period_marker(Pause.config.resolution, Time.now.to_i)
      set       = adapter.key_history(action.scope, action.identifier)
      action.checks.each do |period_check|
        start_time = timestamp - period_check.period_seconds
        set.reverse.inject(0) do |sum, element|
          break if element.ts < start_time
          sum += element.count
          if sum >= period_check.max_allowed
            adapter.rate_limit!(action.scope, action.identifier, period_check.block_ttl)
            # Note that Time.now is different from period_marker(resolution, Time.now), which
            # rounds down to the nearest (resolution) seconds
            return Pause::RateLimitedEvent.new(action, period_check, sum, Time.now.to_i)
          end
          sum
        end
      end
      nil
    end
206439
def validate(self, value, model_instance):
        
        if not isinstance(value, base.StateWrapper):
            raise exceptions.ValidationError(self.error_messages['wrong_type'] % value)
        elif not value.workflow == self.workflow:
            raise exceptions.ValidationError(self.error_messages['wrong_workflow'] % value.workflow)
        elif value.state not in self.workflow.states:
            raise exceptions.ValidationError(self.error_messages['invalid_state'] % value.state)
1127091
def succeed(self, instance, action):
        
        uid = api.get_uid(instance)
        return self.objects.get(uid, {}).get(action, {}).get('success', False)
147600
def is_standard(action):
    
    boolean_actions = (
        _StoreConstAction, _StoreFalseAction,
        _StoreTrueAction
    )
    return (not action.choices
            and not isinstance(action, _CountAction)
            and not isinstance(action, _HelpAction)
            and type(action) not in boolean_actions)
1060787
def check_for_valid_postback_actions(self, required_keys, post_params):
        
        for key in required_keys:
            if key not in post_params:
                return False
        return True