Adds a set of tests based on pattern matching.
978392
public void addFileSet(FileSet fs) {
    add(fs);
    if (fs.getProject() == null) {
      fs.setProject(getProject());
    }
  }
364331
private String[] fillNonPatternSet(Set set, String[] patterns) {
        ArrayList al = new ArrayList(patterns.length);
        for (int i = 0; i < patterns.length; i++) {
            if (!SelectorUtils.hasWildcards(patterns[i])) {
                set.add(isCaseSensitive() ? patterns[i]
                    : patterns[i].toUpperCase());
            } else {
                al.add(patterns[i]);
            }
        }
        return set.size() == 0 ? patterns
            : (String[]) al.toArray(new String[al.size()]);
    }
681541
function addFiles(pattern, cb){
    glob(pattern, function(err, files){
      if(err) throw err;

      async.each(files, readFile, function(err){
        if(err) throw err;
        if(cb) cb();
      });
    });
  }
340464
def add_coverage(self, qname, sname, qcover, scover=None):
        """"""
        self.alignment_coverage.loc[qname, sname] = qcover
        if scover:
            self.alignment_coverage.loc[sname, qname] = scover
1120462
public void addMatch(String strMatch, boolean bAddAll)
    {
        m_setMatches.add(strMatch);
        if (bAddAll)
            if (m_parent instanceof XslImportScanListener)
                ((XslImportScanListener)m_parent).addMatch(strMatch, bAddAll);  // Make sure no one else adds it
        System.out.println("match " + strMatch);
    }
209076
def match_regex_list(patterns, string):
    """"""

    for p in patterns:

        if re.findall(p, string):
            return True

    return False
296813
private void addSymbolsFromSettings() {
        if (!Utils.isNullOrEmpty(context.getSettings().getImportsFile())) {
            Symbols imported = new Symbols();
            for (String name : context.getSettings().getImportsFile().split(";")) {
                try {
                    InputStream is = Utils.getFileOrResource(name);
                    Symbols symbol = JAXB.unmarshal(is, Symbols.class);
                    is.close();
                    imported.getSymbols().addAll(symbol.getSymbols());
                } catch (IOException e) {
                    throw new RuntimeException("Failed to read imports: " + e.getMessage());
                }
            }
            if (Utils.isNullOrEmpty(context.getSettings().getImportFilter())) {
                imports.getSymbols().addAll(imported.getSymbols());
            } else {
                Pattern regex = Pattern.compile(context.getSettings().getImportFilter());
                for (String symbol : imported.getSymbols()) {
                    if (regex.matcher(symbol).matches()) {
                        imports.getSymbols().add(symbol);
                    }
                }
            }
        }
    }
545454
def match(self, files):
        """"""
        if not files:
            return set()

        if (self.matched_inherit.all_files()
                or self.matched_and_subdir.all_files()
                or self.matched_no_subdir.all_files()):
            # Optimization: one of the matched patterns matches everything
            # So simply return it
            return set(files)

        unmatched = set(files)
        matched = set()
        for pattern_set in self._matching_pattern_sets():
            pattern_set.match_files(matched, unmatched)
            if not unmatched:
                # Optimization: If we have matched all files already
                # simply return at this point - nothing else to do
                break

        return matched
843216
private List<TestCaseDef> extendBaseCases( FunctionInputDef inputDef, VarTupleSet validTuples, Iterator<TestCaseDef> baseCases)
    {
    List<TestCaseDef> testCases = new ArrayList<TestCaseDef>();
    
    // For each base test case...
    while( baseCases.hasNext())
      {
      TestCaseDef testCase = baseCases.next();
      logger_.debug( "Extending base test case={}", testCase);

      // Complete all variable bindings.
      if( makeComplete( testCase, validTuples, getVarsRemaining( inputDef, testCase)))
        {
        logger_.debug( "Completed test case={}", testCase);
        validTuples.used( testCase);
        testCases.add( testCase);
        }
      else
        {
        logger_.debug( "Can't complete test case={}", testCase);
        }
      }

    return testCases;
   }
722373
def match_filenames(filenames, pattern):
    """"""
    matching = []

    for filename in filenames:
        if fnmatch(get_filebase(filename, pattern), globify(pattern)):
            matching.append(filename)

    return matching
320788
private void updateEqualSets(Set<AbstractExpression> values,
            HashMap<AbstractExpression, Set<AbstractExpression>> valueEquivalence,
            Set< Set<AbstractExpression> > eqSets,
            AbstractExpression tveKey, AbstractExpression spExpr) {
        boolean hasLegacyValues = false;
        if (eqSets.contains(values)) {
            eqSets.remove(values);
            hasLegacyValues = true;
        }
        values.add(spExpr);
        values.add(tveKey);
        if (hasLegacyValues) {
            eqSets.add(values);
        }
        valueEquivalence.put(spExpr, values);
        valueEquivalence.put(tveKey, values);
    }
412687
def if_match(self, values):
        
        assert isinstance(values, list)
        for v in values:
            option = Option()
            option.number = defines.OptionRegistry.IF_MATCH.number
            option.value = v
            self.add_option(option)
99393
public void setRegexes(String regexes) {
        String[] subPatterns = regexes.split(separate);
        this.regexes = new Pattern[subPatterns.length];
        for (int i = 0; i < subPatterns.length; ++i)
            this.regexes[i] = Pattern.compile(subPatterns[i]);
    }
816045
def _matches_patterns(self, matches, context):
        
        if not self.disabled(context):
            patterns = self.effective_patterns(context)
            for pattern in patterns:
                if not pattern.disabled(context):
                    pattern_matches = pattern.matches(matches.input_string, context)
                    if pattern_matches:
                        log(pattern.log_level, "Pattern has %s match(es). (%s)", len(pattern_matches), pattern)
                    else:
                        pass
                        # log(pattern.log_level, "Pattern doesn't match. (%s)" % (pattern,))
                    for match in pattern_matches:
                        if match.marker:
                            log(pattern.log_level, "Marker found. (%s)", match)
                            matches.markers.append(match)
                        else:
                            log(pattern.log_level, "Match found. (%s)", match)
                            matches.append(match)
                else:
                    log(pattern.log_level, "Pattern is disabled. (%s)", pattern)
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
418961
def append(self, pattern):
        """"""
        assert isinstance(pattern, Pattern)
        self.patterns.append(pattern)
        if self._all_files is not None:
            self._all_files = self._all_files or pattern.all_files()
502420
def file_matches(filename, patterns):
    """"""
    return any(fnmatch.fnmatch(filename, pat)
               or fnmatch.fnmatch(os.path.basename(filename), pat)
               for pat in patterns)