other arguments that require validation.
767705
private List<NamedArgumentDefinition> validatePluginArgumentValues() {
        final List<NamedArgumentDefinition> actualArgumentDefinitions = new ArrayList<>();
        for (final NamedArgumentDefinition argumentDefinition : namedArgumentDefinitions) {
            if (!argumentDefinition.isControlledByPlugin()) {
                actualArgumentDefinitions.add(argumentDefinition);
            } else {
                final boolean isAllowed = argumentDefinition.getDescriptorForControllingPlugin().isDependentArgumentAllowed(
                        argumentDefinition.getContainingObject().getClass());
                if (argumentDefinition.getHasBeenSet()) {
                    if (!isAllowed) {
                        // dangling dependent argument; a value was specified but it's containing
                        // (predecessor) plugin argument wasn't specified
                        throw new CommandLineException(
                                String.format(
                                        "Argument \"%s/%s\" is only valid when the argument \"%s\" is specified",
                                        argumentDefinition.getShortName(),
                                        argumentDefinition.getLongName(),
                                        argumentDefinition.getContainingObject().getClass().getSimpleName()));
                    }
                    actualArgumentDefinitions.add(argumentDefinition);
                } else if (isAllowed) {
                    // the predecessor argument was seen, so this value is allowed but hasn't been set; keep the
                    // argument definition to allow validation to check for missing required args
                    actualArgumentDefinitions.add(argumentDefinition);
                }
            }
        }

        // finally, give each plugin a chance to trim down any unseen instances from it's own list
        pluginDescriptors.entrySet().forEach(e -> e.getValue().validateAndResolvePlugins());

        // return the updated list of argument definitions with the new list
        return actualArgumentDefinitions;
    }
15031
def _ensure_arguments_are_provided(expected_types, arguments):
    """"""
    # This function only checks that the arguments were specified,
    # and does not check types. Type checking is done as part of the actual formatting step.
    expected_arg_names = set(six.iterkeys(expected_types))
    provided_arg_names = set(six.iterkeys(arguments))

    if expected_arg_names != provided_arg_names:
        missing_args = expected_arg_names - provided_arg_names
        unexpected_args = provided_arg_names - expected_arg_names
        raise GraphQLInvalidArgumentError(u'Missing or unexpected arguments found: '
                                          u'missing {}, unexpected '
                                          u'{}'.format(missing_args, unexpected_args))
1057438
def checkValid(cls, reason):
        
        if reason not in cls.__VALID_REASONS:
            raise ValueError("reason must be one of {}, got {}".format(cls.__VALID_REASONS, reason))
1005954
def _validate_str_list(arg):
    '''
    
    '''
    if isinstance(arg, six.binary_type):
        ret = [salt.utils.stringutils.to_unicode(arg)]
    elif isinstance(arg, six.string_types):
        ret = [arg]
    elif isinstance(arg, Iterable) and not isinstance(arg, Mapping):
        ret = []
        for item in arg:
            if isinstance(item, six.string_types):
                ret.append(item)
            else:
                ret.append(six.text_type(item))
    else:
        ret = [six.text_type(arg)]
    return ret
1364316
def validate_arguments(log, whitelisted_args, args):
    """"""
    valid_patterns = {re.compile(p): v for p, v in whitelisted_args.items()}

    def validate(idx):
      arg = args[idx]
      for pattern, has_argument in valid_patterns.items():
        if pattern.match(arg):
          return 2 if has_argument else 1
      log.warn("Zinc argument '{}' is not supported, and is subject to change/removal!".format(arg))
      return 1

    arg_index = 0
    while arg_index < len(args):
      arg_index += validate(arg_index)
555399
def validate_args(self):
        """"""
        base.BaseTarget.validate_args(self)
        params = self.params
        if params['extra_control_fields'] is not None:
            assert isinstance(params['extra_control_fields'], list), (
                'extra_control_fields must be a list of tuples, not %s' % type(
                    params['extra_control_fields']))
            for elem in params['extra_control_fields']:
                assert (isinstance(elem, tuple) and len(elem) == 1), (
                    'extra_control_fields must be a list of 2-element tuples. '
                    'Invalid contents: %s' % elem)
        pkgname_re = '^[a-z][a-z0-9+-.]+'
        assert re.match(pkgname_re, params['package_name']), (
            'Invalid package name: %s. Must match %s' % (
                params['package_name'], pkgname_re))
447960
def assert_valid_other(other)
      other_repository = other.repository
      repository       = self.repository
      other_class      = other.class

      unless other_repository == repository
        raise ArgumentError, "+other+ #{other_class} must be for the #{repository.name} repository, not #{other_repository.name}"
      end

      other_model = other.model
      model       = self.model

      unless other_model >= model
        raise ArgumentError, "+other+ #{other_class} must be for the #{model.name} model, not #{other_model.name}"
      end
    end
319588
function validateArgs(args) {
    if (args.length === 0) {
      grunt.log.error('Unable to run task: no action specified (e.g. run or update)');
      return false;
    } else if (args.length === 1) {
      grunt.log.error('Unable to run task: no target specified');
      return false;
    } else if (args.length > 3) {
      grunt.log.error('Unable to run task: too many arguments (up to 4 allowed)');
      return false;
    }

    return true;
  }
734466
function validArguments() {
    var conditions = {
      'port and host': function () {
        return port && host;
      },
      'options.target or options.router': function () {
        return options && (options.router ||
          (options.target && options.target.host && options.target.port));
      },
      'or proxy handlers': function () {
        return handlers && handlers.length;
      }
    }

    var missing = Object.keys(conditions).filter(function (name) {
      return !conditions[name]();
    });

    if (missing.length === 3) {
      message = 'Cannot proxy without ' + missing.join(', ');
      return false;
    }

    return true;
  }
1105028
public function validateArguments()
    {
        parent::validateArguments();

        if (empty($this->arguments['signature'])
            && (empty($this->arguments['extension']) || empty($this->arguments['main']) || empty($this->arguments['sub'])
            )
        ) {
            throw new \InvalidArgumentException('ifHasAccessToModule view helper requires either "signature" or all three other arguments: "extension", "main" and "sub". Please set arguments properly.', 1496314352);
        }
    }
1123274
def check_arguments(self):
        
        for k, v in self.Parameters.iteritems():
            if self.Parameters[k].isOn():
                if k in self._valid_arguments:
                    if not self._valid_arguments[k](v.Value):
                        error_message = 'Invalid argument (%s) ' % v.Value
                        error_message += 'for parameter %s\n' % k
                        raise InvalidArgumentApplicationError(error_message)
959134
def check_required_args(required_args, args):
    
    for arg in required_args:
        if arg not in args:
            raise KeyError('Required argument: %s' % arg)
    return True
1330060
function requireValidOptionalObject (arg) {
    // if arg is undefined then return empty object
    if (arg === undefined) {
        return {}
    }
    // throw error if arg is not an object
    if (!arg || typeof arg !== 'object' || Array.isArray(arg)) {
        throw new Error('argument error: argument must be an object')
    }
    // return validated object
    return arg
}
293495
def verify_arguments(self, args=None, kwargs=None):
        

        args = self.args if args is None else args
        kwargs = self.kwargs if kwargs is None else kwargs

        try:
            verify_arguments(self._target, self._method_name, args, kwargs)
        except VerifyingBuiltinDoubleArgumentError:
            if doubles.lifecycle.ignore_builtin_verification():
                raise
604707
def _validate(self, value):
        
        errors = []
        kwargs = {}
        for validator in self.validators:
            try:
                r = validator(value)
                if not isinstance(validator, Validator) and r is False:
                    self.fail('validator_failed')
            except ValidationError as err:
                kwargs.update(err.kwargs)
                if isinstance(err.messages, dict):
                    errors.append(err.messages)
                else:
                    errors.extend(err.messages)
        if errors:
            raise ValidationError(errors, **kwargs)
1132253
function validateArguments(parens, elements) {
            const leftParen = parens.leftParen;
            const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParen);
            const hasLeftNewline = !astUtils.isTokenOnSameLine(leftParen, tokenAfterLeftParen);
            const needsNewlines = shouldHaveNewlines(elements, hasLeftNewline);

            for (let i = 0; i <= elements.length - 2; i++) {
                const currentElement = elements[i];
                const nextElement = elements[i + 1];
                const hasNewLine = currentElement.loc.end.line !== nextElement.loc.start.line;

                if (!hasNewLine && needsNewlines) {
                    context.report({
                        node: currentElement,
                        messageId: "expectedBetween",
                        fix: fixer => fixer.insertTextBefore(nextElement, "\n")
                    });
                }
            }
        }
321861
def validate_args(self):
        
        from ..mixins import ModelMixin

        for arg in ("instance", "decider", "identifier", "fields", "default_language"):
            if getattr(self, arg) is None:
                raise AttributeError("%s must not be None" % arg)

        if not isinstance(self.instance, (ModelMixin,)):
            raise ImproperlyConfigured('"instance" argument must be a Linguist model')

        if not issubclass(self.decider, (models.Model,)):
            raise ImproperlyConfigured(
                '"decider" argument must be a valid Django model'
            )