Adds valid match group parameters to the configuration.
191534
def _ParseMatchGrp(self, key, val):
    """"""
    if key in self._match_keywords:
      self._ParseEntry(key, val)
75810
public void setParameterGroups(java.util.Collection<ParameterGroup> parameterGroups) {
        if (parameterGroups == null) {
            this.parameterGroups = null;
            return;
        }

        this.parameterGroups = new java.util.ArrayList<ParameterGroup>(parameterGroups);
    }
400295
def add(self, rule, method, target, name=None):
        '''  '''
        anons     = 0    # Number of anonymous wildcards found
        keys      = []   # Names of keys
        pattern   = ''   # Regular expression pattern with named groups
        filters   = []   # Lists of wildcard input filters
        builder   = []   # Data structure for the URL builder
        is_static = True

        for key, mode, conf in self._itertokens(rule):
            if mode:
                is_static = False
                if mode == 'default': mode = self.default_filter
                mask, in_filter, out_filter = self.filters[mode](conf)
                if not key:
                    pattern += '(?:%s)' % mask
                    key = 'anon%d' % anons
                    anons += 1
                else:
                    pattern += '(?P<%s>%s)' % (key, mask)
                    keys.append(key)
                if in_filter: filters.append((key, in_filter))
                builder.append((key, out_filter or str))
            elif key:
                pattern += re.escape(key)
                builder.append((None, key))

        self.builder[rule] = builder
        if name: self.builder[name] = builder

        if is_static and not self.strict_order:
            self.static.setdefault(method, {})
            self.static[method][self.build(rule)] = (target, None)
            return

        try:
            re_pattern = re.compile('^(%s)$' % pattern)
            re_match = re_pattern.match
        except re.error:
            raise RouteSyntaxError("Could not add Route: %s (%s)" % (rule, _e()))

        if filters:
            def getargs(path):
                url_args = re_match(path).groupdict()
                for name, wildcard_filter in filters:
                    try:
                        url_args[name] = wildcard_filter(url_args[name])
                    except ValueError:
                        raise HTTPError(400, 'Path has wrong format.')
                return url_args
        elif re_pattern.groupindex:
            def getargs(path):
                return re_match(path).groupdict()
        else:
            getargs = None

        flatpat = _re_flatten(pattern)
        whole_rule = (rule, flatpat, target, getargs)

        if (flatpat, method) in self._groups:
            if DEBUG:
                msg = 'Route <%s %s> overwrites a previously defined route'
                warnings.warn(msg % (method, rule), RuntimeWarning)
            self.dyna_routes[method][self._groups[flatpat, method]] = whole_rule
        else:
            self.dyna_routes.setdefault(method, []).append(whole_rule)
            self._groups[flatpat, method] = len(self.dyna_routes[method]) - 1

        self._compile(method)
1065082
def build_groups(self, tokens):
        """"""
        groups = {}
        for token in tokens:
            match_type = MatchType.start if token.group_end else MatchType.single
            groups[token.group_start] = (token, match_type)
            if token.group_end:
                groups[token.group_end] = (token, MatchType.end)
        return groups
422783
def expand_groups(grp):
    
    p = re.compile(r"(?P<name>.+)\[(?P<start>\d+)-(?P<end>\d+)\]")
    m = p.match(grp)
    if m is not None:
        s = int(m.group('start'))
        e = int(m.group('end'))
        n = m.group('name')
        return list(map(lambda x: n + str(x), range(s, e + 1)))
    else:
        return [grp]
275198
def add_params(self, p):
        """"""
        new_params = p.copy()
        for key,val in new_params.items():
            if not isinstance(val, collections.Iterable):
                new_params[key] = [new_params[key]]
            #_check_comb_param(key, val)
        self.comb_params.update(new_params)
1110260
def configure(self, config):
        """"""
        super().configure(config)

        self._regex = self._build_matcher(config.get(
            'regex{suffix}'.format(suffix=self._option_suffix),
            fallback=self._regex.pattern))
1004121
def _set_optimizer_param(optimizer, param_group, param_name, value):
    
    if param_group == 'all':
        groups = optimizer.param_groups
    else:
        groups = [optimizer.param_groups[int(param_group)]]

    for group in groups:
        group[param_name] = value
1202080
protected void registerHorizontalGroupAttributes() {
        addAttributeProcessor(new HorizontalGroupAlignmentLmlAttribute(), "groupAlign");
        addAttributeProcessor(new HorizontalGroupFillLmlAttribute(), "groupFill");
        addAttributeProcessor(new HorizontalGroupPaddingBottomLmlAttribute(), "groupPadBottom");
        addAttributeProcessor(new HorizontalGroupPaddingLeftLmlAttribute(), "groupPadLeft");
        addAttributeProcessor(new HorizontalGroupPaddingLmlAttribute(), "groupPad", "padding");
        addAttributeProcessor(new HorizontalGroupPaddingRightLmlAttribute(), "groupPadRight");
        addAttributeProcessor(new HorizontalGroupPaddingTopLmlAttribute(), "groupPadTop");
        addAttributeProcessor(new HorizontalGroupReverseLmlAttribute(), "reverse");
        addAttributeProcessor(new HorizontalGroupSpacingLmlAttribute(), "groupSpace", "spacing");
    }
1372924
public static void validateBindParametersTypes(Parameters parameters) {
		final Iterator<Parameter> it = parameters.iterator();

		while (it.hasNext()) {
			final Parameter param = it.next();
			final Class<?> paramType = param.getType();

			if (!(param.isSpecialParameter() || SupportedCoreTypes
					.isSupported(paramType))) {
				throw (new IllegalArgumentException("Type " + paramType
						+ " not supported as an annotated query parameter!"));
			}
		}
	}
1270400
def _build_matches(matches, uuids, no_filtered, fastmode=False):
    """"""

    result = []

    for m in matches:
        mk = m[0].uuid if not fastmode else m[0]
        subset = [uuids[mk]]

        for id_ in m[1:]:
            uk = id_.uuid if not fastmode else id_
            u = uuids[uk]

            if u not in subset:
                subset.append(u)

        result.append(subset)

    result += no_filtered
    result.sort(key=len, reverse=True)

    sresult = []
    for r in result:
        r.sort(key=lambda id_: id_.uuid)
        sresult.append(r)

    return sresult
1000769
def validate_config_parameters(config_json, allowed_keys, allowed_types):
    """"""
    custom_fields = config_json.get(defs.PARAMETERS, [])
    for field in custom_fields:
        validate_field(field, allowed_keys, allowed_types)
        default = field.get(defs.DEFAULT)
        field_type = field.get(defs.TYPE)
        if default:
            validate_field_matches_type(field[defs.VALUE], default, field_type)
672080
def add_parameters(parser):
    """"""
    group = parser.add_argument_group('Evaluation arguments')

    group.add_argument('--eval-batch-size', type=int, default=1024)

    # Datasets
    group.add_argument(
        '--similarity-datasets', type=str,
        default=nlp.data.word_embedding_evaluation.word_similarity_datasets,
        nargs='*',
        help='Word similarity datasets to use for intrinsic evaluation.')
    group.add_argument(
        '--similarity-functions', type=str,
        default=nlp.embedding.evaluation.list_evaluation_functions(
            'similarity'), nargs='+',
        help='Word similarity functions to use for intrinsic evaluation.')
    group.add_argument(
        '--analogy-datasets', type=str, default=['GoogleAnalogyTestSet'],
        nargs='*',
        help='Word similarity datasets to use for intrinsic evaluation.')
    group.add_argument(
        '--analogy-functions', type=str,
        default=nlp.embedding.evaluation.list_evaluation_functions('analogy'),
        nargs='+',
        help='Word analogy functions to use for intrinsic evaluation. ')

    ## Analogy evaluation specific arguments
    group.add_argument(
        '--analogy-dont-exclude-question-words', action='store_true',
        help=('Exclude input words from valid output analogies.'
              'The performance of word embeddings on the analogy task '
              'is around 0% accuracy if input words are not excluded.'))
1190598
public void add(Collection<ConfigurationMetadataSource> sources) {
		for (ConfigurationMetadataSource source : sources) {
			String groupId = source.getGroupId();
			ConfigurationMetadataGroup group = this.allGroups.get(groupId);
			if (group == null) {
				group = new ConfigurationMetadataGroup(groupId);
				this.allGroups.put(groupId, group);
			}
			String sourceType = source.getType();
			if (sourceType != null) {
				putIfAbsent(group.getSources(), sourceType, source);
			}
		}
	}
1190485
def addParameter( self, k, r ):
        """"""

        if isinstance(r, six.string_types) or not isinstance(r, collections.Iterable):
            # range is a single value (where a string constitutes a single value), make it a list
            r = [ r ]
        else:
            if isinstance(r, collections.Iterable):
                # range is an iterable, make into a list
                r = list(r)

        self._parameters[k] = r
645877
private void addGroup(List<Token> group, List<List<Token>> groups) {

    if(group.isEmpty()) return;

    // remove trailing tokens that should be ignored
    while(!group.isEmpty() && IGNORED_TRAILING_TOKENS.contains(
        group.get(group.size() - 1).getType())) {
      group.remove(group.size() - 1);
    }

    // if the group still has some tokens left, we'll add it to our list of groups
    if(!group.isEmpty()) {
      groups.add(group);
    }
  }
617556
private function doAddMatchers()
    {
        if (!empty($this->newMatchers)) {
            $this->shell->addMatchers($this->newMatchers);
            $this->newMatchers = [];
        }
    }