Check if the arguments fit the requirements of the command.

		Raises ArgumentError_, if an argument does not fit.
508200
def checkargs(self, lineno, command, args):
		
		for wanted, arg in zip(command.argtypes(), args):
			wanted = wanted.type_
			if(wanted == "register" and (not arg in self.register)):
				raise ArgumentError("[line {}]: Command '{}' wants argument of type register, but {} is not a register".format(lineno, command.mnemonic(), arg))
			if(wanted == "const" and (arg in self.register)):
				raise ArgumentError("[line {}]: Command '{}' wants argument of type const, but {} is a register.".format(lineno, command.mnemonic(), arg))
611161
def match(self, command_context=None, **command_env):
		
		spec = self.specification()
		if command_context is None and spec is None:
			return True
		elif command_context is not None and spec is not None:
			return command_context == spec
		return False
845585
def check_args(parser, args):
    """"""
    # Make sure only one action has been specified
    if len([a for a in [args.create, args.extract, args.verify, args.list,
                        args.list_detailed, args.hash, args.add_signature] if a
            is not None]) != 1:
        parser.error("Must specify something to do (one of -c, -x, -t, -T, -v, --hash, --add-signature)")

    if args.create and not args.files:
        parser.error("Must specify at least one file to add to marfile")

    if args.extract and args.compression not in (None, 'bz2', 'xz', 'auto'):  # pragma: nocover
        parser.error('Unsupported compression type')

    if args.create and args.compression not in (None, 'bz2', 'xz'):  # pragma: nocover
        parser.error('Unsupported compression type')

    if args.hash and len(args.files) != 1:
        parser.error("Must specify a file to output the hash for")
1131893
def _check_arg(self, arg):
        
        if isinstance(arg, list):
            return self._get_dependencies_from_args(arg)
        elif isinstance(arg, dict):
            return self._get_dependencies_from_kwargs(arg)

        if not is_dependency_name(arg):
            return set()
        return set([arg[1:]])
1142101
def validate_args(args):
    """"""
    if not any([args.environment, args.stage, args.account]):
        sys.exit(NO_ACCT_OR_ENV_ERROR)
    if args.environment and args.account:
        sys.exit(ENV_AND_ACCT_ERROR)
    if args.environment and args.role:
        sys.exit(ENV_AND_ROLE_ERROR)
1279474
def _check_args(*argl, **argd):
    
    args = {"_": []}
    for item in argl:
        args["_"].append(_tracker_str(item))
           
    for key, item in argd.items():
        args[key] = _tracker_str(item)
        
    return args
241745
function checkRequired(k, cb) {
    if (k in args)
      return cb(null);
    else
      return cb(buildError(k, 'argument missing'));
  }
362551
def check_help():
    
    # know arguments
    know = set(('-h', '--help', '-v', '--version'))
    # arguments
    args = set(sys.argv[1:])
    # returns True if there is at least one known argument in arguments
    return len(know.intersection(args)) > 0
807191
def check_params(**kwargs):
    

    missing_params = []
    check = True

    for param in kwargs:
        if kwargs[param] is None:
            missing_params.append(param)

    if len(missing_params) > 0:
        print("POT - Warning: following necessary parameters are missing")
        for p in missing_params:
            print("\n", p)

        check = False

    return check
720468
def check_arguments(args):
	
	projectname_re = re.compile(r'[^a-zA-Z0-9_]')
	if args['genconfig']:
		if args['--type'] not in ['scraper', 'crawler']:
			raise InvalidType("--type has to be 'scraper' or 'crawler'")
		if args['--selector'] not in ['xpath', 'css']:
			raise InvalidSelector("--selector has to be 'xpath' or 'css'")
	if args['generate'] or args['run']:
		if args['--output_type'] not in ['json', 'csv']:
			raise InvalidOutputType("--output_type has to be 'json' or 'csv'")
	if args['genconfig'] or args['generate'] or args['run']:
		if projectname_re.search(args['<projectname>']) is not None:
			message = "<projectname> should consist of letters, digits or _"
			raise InvalidProjectName(message)
	try:
		if int(args['--levels']) < 1:
			message = "--levels should be greater than, or equal to 1"
			raise InvalidLevels(message)
	except (TypeError, ValueError):
		message = " ".join([
			"--levels should be an integer and not of type",
			"{}".format(type(args['--levels']))
		])
		raise InvalidLevels(message)
973155
def _check_argument_units(args, dimensionality):
    """"""
    for arg, val in args.items():
        # Get the needed dimensionality (for printing) as well as cached, parsed version
        # for this argument.
        try:
            need, parsed = dimensionality[arg]
        except KeyError:
            # Argument did not have units specified in decorator
            continue

        # See if the value passed in is appropriate
        try:
            if val.dimensionality != parsed:
                yield arg, val.units, need
        # No dimensionality
        except AttributeError:
            # If this argument is dimensionless, don't worry
            if parsed != '':
                yield arg, 'none', need
1110823
def check_arguments(cls, conf):
        
        # Checking the interval
        if not conf['tcp_check_interval']:
            raise ArgsError("A TCP health-test interval needs to be "
                            "specified (--tcp_check_interval).")

        if not (1 <= conf['tcp_check_interval'] <= 3600):
            raise ArgsError("Specified TCP health-test interval must be "
                            "between 1 and 3600 seconds")

        # Checking the port
        if not conf['tcp_check_port']:
            raise ArgsError("A port for the TCP health-test needs to be "
                            "specified (--tcp_check_port).")

        if not (1 <= conf['tcp_check_port'] <= 65535):
            raise ArgsError("Specified port for TCP health-test must be "
                            "between 1 and 65535")
946717
def check_command(self, command):
        

        # Use `command` to see if command is callable, store exit code
        code = os.system("command -v {0} >/dev/null 2>&1 || {{ exit 1; }}".format(command))

        # If exit code is not 0, report which command failed and return False, else return True
        if code != 0:
            print("Command is not callable: {0}".format(command))
            return False
        else:
            return True
882125
def check_arg_compatibility(args: argparse.Namespace):
    

    if args.lhuc is not None:
        # Actually this check is a bit too strict
        check_condition(args.encoder != C.CONVOLUTION_TYPE or args.decoder != C.CONVOLUTION_TYPE,
                        "LHUC is not supported for convolutional models yet.")
        check_condition(args.decoder != C.TRANSFORMER_TYPE or C.LHUC_STATE_INIT not in args.lhuc,
                        "The %s options only applies to RNN models" % C.LHUC_STATE_INIT)

    if args.decoder_only:
        check_condition(args.decoder != C.TRANSFORMER_TYPE and args.decoder != C.CONVOLUTION_TYPE,
                        "Decoder pre-training currently supports RNN decoders only.")
680299
def is_valid(cls, arg):
        
        return (isinstance(arg, (int, long)) and (arg >= 0)) or \
            isinstance(arg, str)
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)
685157
def validate_args(args):
    """"""
    # Check correctness of similarity dataset names
    for dataset_name in args.similarity_datasets:
        if dataset_name.lower() not in map(
                str.lower,
                nlp.data.word_embedding_evaluation.word_similarity_datasets):
            print('{} is not a supported dataset.'.format(dataset_name))
            sys.exit(1)

    # Check correctness of analogy dataset names
    for dataset_name in args.analogy_datasets:
        if dataset_name.lower() not in map(
                str.lower,
                nlp.data.word_embedding_evaluation.word_analogy_datasets):
            print('{} is not a supported dataset.'.format(dataset_name))
            sys.exit(1)