Checks for the presence of an extra to the argument list. Raises expections
    if this is unexpected or if it is missing and expected.
423635
def _expect_extra(expected, present, exc_unexpected, exc_missing, exc_args):
    
    if present:
        if not expected:
            raise exc_unexpected(*exc_args)
    elif expected and expected is not Argument.ignore:
        raise exc_missing(*exc_args)
1293948
def contains_extra(marker):
    
    if not marker:
        return False
    marker = _ensure_marker(marker)
    return _markers_contains_extra(marker._markers)
1198521
def assert_is_not(expected, actual, message=None, extra=None):
    """"""
    assert expected is not actual, _assert_fail_message(
        message, expected, actual, "is", extra
    )
1281691
def AddArg(self, arg):
    
    self.args.append(arg)
    if len(self.args) > self.number_of_args:
      raise ParseError("Too many args for this expression.")

    elif len(self.args) == self.number_of_args:
      return True

    return False
1313424
def check_arguments(self):
        """"""
        for name, default in self.argdict.items():
            if name not in self.names and default is NODEFAULT:
                raise NameError('Missing argparse specification for %r' % name)
1044869
private void checkArgument(boolean argument, String msg, Object... args) {
        if (!argument) {
            throw new IllegalArgumentException(String.format(msg, args));
        }
    }
388677
def check_arguments(cls, passed):
        """"""
        defaults = list(cls.default_arguments().keys())
        template = ("Pass arg {argument:!r} in {cname:!r}, can be a typo? "
                    "Supported key arguments: {defaults}")
        fails = []
        for arg in passed:
            if arg not in defaults:
                warn(template.format(argument=arg,
                                     cname=cls.__name__,
                                     defaults=defaults))
                fails.append(arg)

        return any(fails)
360909
def extras_msg(extras):
    

    if len(extras) == 1:
        verb = "was"
    else:
        verb = "were"
    return ", ".join(repr(extra) for extra in extras), verb
13601
def rx_int_extra(rxmatch):
    

    rxmatch = re.search("\d+", rxmatch.group(0))
    return int(rxmatch.group(0))
366950
def check_extras(dist, attr, value):
    """"""
    try:
        list(itertools.starmap(_check_extra, value.items()))
    except (TypeError, ValueError, AttributeError):
        raise DistutilsSetupError(
            "'extras_require' must be a dictionary whose values are "
            "strings or lists of strings containing valid project/version "
            "requirement specifiers."
        )
1324872
def only_extras(self):
        
        known = [key for key in self._dict.keys() if key in self.c_param]
        if not known:
            return True
        else:
            return False
805395
def validate_include_exclude(include, exclude):
    
    if include is not None and exclude is not None:
        raise ValueError("Only one of 'include' or 'exclude' argument should be provided.")
    validate('include', include, instance_of=(str, Sequence), enforce_not_none=False)
    validate('exclude', exclude, instance_of=(str, Sequence), enforce_not_none=False)
1213308
def _verify_params(self):
        
        reserved_in_use = self._RESERVED_PARAMS.intersection(self.extra_params)
        if reserved_in_use:
            raise ValueError("Using a reserved parameter", reserved_in_use)
1374183
def _check_required(self, value):
        '''
        
        '''
        if value is None and self._required:
            err_msg = self._errors['required'].format(self.__class__.__name__, self.name)
            if self.container_model:
                err_msg += self._errors['required_extra'].format(self.container_model.__name__)
            raise ValueError(err_msg)
168540
def *(other)
      if other.is_a?(Value)
        other = other.to_f
      end
      if other.is_a?(Numeric)
        to_f * other
      else
        raise "Unexpected argument (#{other.inspect})"
      end
    end
134787
def assert_unordered_list_eq(expected, actual, message=None):
    
    missing_in_actual = []
    missing_in_expected = list(actual)
    for x in expected:
        try:
            missing_in_expected.remove(x)
        except ValueError:
            missing_in_actual.append(x)

    if missing_in_actual or missing_in_expected:
        if not message:
            message = (
                "%r not equal to %r; missing items: %r in expected, %r in actual."
                % (expected, actual, missing_in_expected, missing_in_actual)
            )
        assert False, message
1270380
def __args_check(self, valid, args=None, kwargs=None):
        '''
        
        '''
        if not isinstance(valid, list):
            valid = [valid]
        for cond in valid:
            if not isinstance(cond, dict):
                # Invalid argument
                continue
            # whitelist args, kwargs
            cond_args = cond.get('args', [])
            good = True
            for i, cond_arg in enumerate(cond_args):
                if args is None or len(args) <= i:
                    good = False
                    break
                if cond_arg is None:  # None == '.*' i.e. allow any
                    continue
                if not self.match_check(cond_arg, six.text_type(args[i])):
                    good = False
                    break
            if not good:
                continue
            # Check kwargs
            cond_kwargs = cond.get('kwargs', {})
            for k, v in six.iteritems(cond_kwargs):
                if kwargs is None or k not in kwargs:
                    good = False
                    break
                if v is None:  # None == '.*' i.e. allow any
                    continue
                if not self.match_check(v, six.text_type(kwargs[k])):
                    good = False
                    break
            if good:
                return True
        return False