Checks list of arguments
550297
public static void checkArgList(DataFetchingEnvironment environment, String... args) {
        Set<String> actualArgs = getActualArguments(environment).keySet();
        Set<String> expectedArgs = new HashSet<>(Arrays.asList(args));
        if (!Objects.equals(actualArgs, expectedArgs)) {
            throw new IllegalStateException(
                    String.format(
                            "Expected this list of arguments: %s, but was: %s",
                            expectedArgs,
                            actualArgs
                    )
            );
        }
    }
283568
def check_args!
      ::Hash[@args.zip(::ARGV)].each do |arg_name,arg_value|
        if @arg_options[arg_name].include? :required
          if arg_value.nil?
            message = "'#{arg_name.to_s}' is required"
            message = "at least one " + message if @arg_options[arg_name].include? :many
            raise ::OptionParser::ParseError,message
          end
        end
      end
    end
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)
765939
function checkArgument(i) {
  let l;

  if (l = checkBrackets(i)) tokens[i].argument_child = 1;
  else if (l = checkParentheses(i)) tokens[i].argument_child = 2;
  else if (l = checkSingleValueDeclaration(i)) tokens[i].argument_child = 3;
  else if (l = checkFunctionsList(i)) tokens[i].argument_child = 4;
  else if (l = checkFunction(i)) tokens[i].argument_child = 5;
  else if (l = checkVariablesList(i)) tokens[i].argument_child = 6;
  else if (l = checkVariable(i)) tokens[i].argument_child = 7;
  else if (l = checkSC(i)) tokens[i].argument_child = 8;
  else if (l = checkDelim(i)) tokens[i].argument_child = 9;
  else if (l = checkDeclDelim(i)) tokens[i].argument_child = 10;
  else if (l = checkString(i)) tokens[i].argument_child = 11;
  else if (l = checkPercentage(i)) tokens[i].argument_child = 12;
  else if (l = checkDimension(i)) tokens[i].argument_child = 13;
  else if (l = checkNumber(i)) tokens[i].argument_child = 14;
  else if (l = checkUri(i)) tokens[i].argument_child = 15;
  else if (l = checkInterpolation(i)) tokens[i].argument_child = 16;
  else if (l = checkIdent(i)) tokens[i].argument_child = 17;
  else if (l = checkVhash(i)) tokens[i].argument_child = 18;
  else if (l = checkCustomProperty(i)) tokens[i].argument_child = 19;
  else if (l = checkOperator(i)) tokens[i].argument_child = 20;
  else if (l = checkUnary(i)) tokens[i].argument_child = 21;
  else if (l = checkParentSelector(i)) tokens[i].argument_child = 22;
  else if (l = checkImportant(i)) tokens[i].argument_child = 23;
  else if (l = checkGlobal(i)) tokens[i].argument_child = 24;
  else if (l = checkDefault(i)) tokens[i].argument_child = 25;
  else if (l = checkOptional(i)) tokens[i].argument_child = 26;

  return l;
}
397559
def check_args(args):
    
    if not os.path.exists(args.fd):
        print("Not a valid path", args.fd, file=ERROR_LOG)
        return [], [], False
    if args.fl is not None:
        # we already ensure the file can be opened and opened the file
        file_line = args.fl.readline()
        amr_ids = file_line.strip().split()
    elif args.f is None:
        print("No AMR ID was given", file=ERROR_LOG)
        return [], [], False
    else:
        amr_ids = args.f
    names = []
    check_name = True
    if args.p is None:
        names = get_names(args.fd, amr_ids)
        # no need to check names
        check_name = False
        if len(names) == 0:
            print("Cannot find any user who tagged these AMR", file=ERROR_LOG)
            return [], [], False
        else:
            names = args.p
    if len(names) == 0:
        print("No user was given", file=ERROR_LOG)
        return [], [], False
    if len(names) == 1:
        print("Only one user is given. Smatch calculation requires at least two users.", file=ERROR_LOG)
        return [], [], False
    if "consensus" in names:
        con_index = names.index("consensus")
        names.pop(con_index)
        names.append("consensus")
    # check if all the AMR_id and user combinations are valid
    if check_name:
        pop_name = []
        for i, name in enumerate(names):
            for amr in amr_ids:
                amr_path = args.fd + name + "/" + amr + ".txt"
                if not os.path.exists(amr_path):
                    print("User", name, "fails to tag AMR", amr, file=ERROR_LOG)
                    pop_name.append(i)
                    break
        if len(pop_name) != 0:
            pop_num = 0
            for p in pop_name:
                print("Deleting user", names[p - pop_num], "from the name list", file=ERROR_LOG)
                names.pop(p - pop_num)
                pop_num += 1
        if len(names) < 2:
            print("Not enough users to evaluate. Smatch requires >2 users who tag all the AMRs", file=ERROR_LOG)
            return "", "", False
    return amr_ids, names, True
597649
def _correct_args(func, kwargs):
    
    args = inspect.getargspec(func)[0]
    return [kwargs[arg] for arg in args] + kwargs['__args']
550564
def isuncertainties(arg_list):
    
    for arg in arg_list:
        if isinstance(arg, (list, tuple)) and isinstance(arg[0], uct.UFloat):
            return True
        elif isinstance(arg, np.ndarray) and isinstance(
                np.atleast_1d(arg)[0], uct.UFloat):
            return True
        elif isinstance(arg, (float, uct.UFloat)) and \
                isinstance(arg, uct.UFloat):
            return True
    return False
664370
def find_args(event, arg_type):
    """"""
    args = event.get('arguments', {})
    obj_tags = [arg for arg in args if arg['type'] == arg_type]
    if obj_tags:
        return [o['value']['@id'] for o in obj_tags]
    else:
        return []
220438
function collectArguments(args) {
  for (var i = 0; i < args.length; i += 2) {
    if (args[i].lastIndexOf('--', 0) !== 0) {
      --i;
      continue;
    }

    flags[args[i]] = args[i + 1];
  }
}
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
626140
def check_args(self):
        
        parser = get_base_arguments(get_parser())
        parser = get_tc_arguments(parser)
        # Disable "Do not use len(SEQ) as condition value"
        # pylint: disable=C1801
        if len(sys.argv) < 2:
            self.logger.error("Icetea called with no arguments! ")
            parser.print_help()
            return False
        elif not self.args.ignore_invalid_params and self.unknown:
            self.logger.error("Unknown parameters received, exiting. "
                              "To ignore this add --ignore_invalid_params flag.")
            self.logger.error("Following parameters were unknown: {}".format(self.unknown))
            parser.print_help()
            return False
        return True
366383
def has_args():
        '''  '''
        no_args_syntax = '@overload'
        args_syntax = no_args_syntax + '('
        args, no_args = [(-1,-1)], [(-1,-1)]
        for i, line in enumerate(Overload.traceback_lines()):
            if args_syntax in line:
                args.append((i, line.find(args_syntax)))
            if no_args_syntax in line:
                no_args.append((i, line.find(no_args_syntax)))
        args, no_args = max(args), max(no_args)
        if sum(args)+sum(no_args) == -4:
            # couldnt find invocation
            return False
        return args >= no_args
841550
def validate_args(args):
    
    if not os.path.isdir(args.directory):
        print "Directory {} does not exist".format(args.directory)
        sys.exit(5)
    return args
502789
def _parse_arguments(arguments=None):
    """"""
    dir_hash = hashlib.sha1(os.getcwd().encode("utf-8")).hexdigest()

    parser = argparse.ArgumentParser(description="""Lint for Polysquare style guide""")
    parser.add_argument("--checks",
                        nargs=0,
                        action=ShowAvailableChecksAction,
                        help="""list available checks""")
    parser.add_argument("files",
                        nargs="*",
                        metavar=("FILE"),
                        help="""read FILE""",
                        type=str)
    parser.add_argument("--whitelist",
                        nargs="*",
                        help="""list of checks that should only be run""",
                        default=None)
    parser.add_argument("--blacklist",
                        nargs="*",
                        help="""list of checks that should never be run""",
                        default=None)
    parser.add_argument("--fix-what-you-can",
                        action="store_const",
                        help="""fix errors automatically""",
                        const=True)
    parser.add_argument("--spellcheck-cache",
                        help="""path to spell-checking cache file""",
                        default=None)
    parser.add_argument("--log-technical-terms-to",
                        help="""path to file to log technical terms to""",
                        default=None)
    parser.add_argument("--stamp-file-path",
                        help="""path to directory to store cached results""",
                        default=os.path.join(tempfile.gettempdir(),
                                             "jobstamps",
                                             "spellcheck_linter",
                                             dir_hash))
    parser.add_argument("--block-regexps",
                        help="""Regular expressions to exclude from all checks.""",
                        nargs="*",
                        default=None)

    return parser.parse_args(arguments)
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
865046
def is_argument(self, name):
        
        if name == self.vararg:
            return True
        if name == self.kwarg:
            return True
        return (
            self.find_argname(name, True)[1] is not None
            or self.kwonlyargs
            and _find_arg(name, self.kwonlyargs, True)[1] is not None
        )
406471
def _check_args(self, source):
        '''
        '''
        path = [source]
        args = self.parsed_yaml.get('args', {})
        self._assert_struct_type(args, 'args', (dict, list), path)
        path.append('args')
        if isinstance(args, dict):
            for argn, argattrs in args.items():
                self._check_one_arg(path, argn, argattrs)
        else: # must be list - already asserted struct type
            for argdict in args:
                self._assert_command_dict(argdict, '[list-item]', path)
                argn, argattrs = list(argdict.items())[0] # safe - length asserted on previous line
                self._check_one_arg(path, argn, argattrs)