Creates a function that tries a match and executes the given fn if successful. If not it tries subsequent patterns.
338126
function matcher (patternFn, successFn, chain) {
    var matcherObj = new Matcher(patternFn, successFn);
  
    // If a chain was provided, add the new matcher to the end of the chain.
    if (chain) {
      chain.last().next = matcherObj;
    } else {
      chain = matcherObj;
    }
  
    var fn = function () {
      // This seems like an odd optimization, but manually copying the
      // arguments object over to an array instead of calling `slice` can
      // speed up dispatch time 2-3x.
      var args = [], i = 0, len = arguments.length;
      for (; i < len; i++) args[i] = arguments[i];
      return chain.match(args, this);
    };
  
    fn.alt = function () {
      var args = slice.call(arguments);
      args.push(chain);
      return pattern.apply(null, args);
    };
  
    fn.__matchChain = chain;
  
    return fn;
  }
508391
def match(self, category, pattern):
        """"""

        return fnmatch.fnmatch(category, pattern, flags=self.FNMATCH_FLAGS)
1128117
function match(regexp) {
      var O = defined(this);
      var fn = regexp == undefined ? undefined : regexp[MATCH];
      return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
    }
880829
function SingleMatcherIterator(i, node, match) {
  this.i = i;
  this.n = node;
  this.m = match;
  this.f = true;
}
546573
def match(Class, path, pattern, flags=re.I, sortkey=None, ext=None):
        """"""
        return sorted(
            [
                Class(fn=fn)
                for fn in rglob(path, f"*{ext or ''}")
                if re.search(pattern, os.path.basename(fn), flags=flags) is not None
                and os.path.basename(fn)[0] != '~'  # omit temp files
            ],
            key=sortkey,
        )
1217914
def is_match(self, match):
        
        result = False
        if self == match:
            result = True
        elif isinstance(match, str) and fnmatchcase(self.name, match):
            result = True  # Found by instance or name
        return result
1043273
function match(source, cases, isExec) {
      if (!isObj(cases)) throwErr('obj');
      if (isUdf(isExec)) isExec = true;
      var symbol = '__@fnMatch__';
      if (has(cases, source)) {
        symbol = source;
      } else if (has(cases, 'default')) {
        symbol = 'default';
      }
      var matched = cases[symbol];
      if (matched === '@next') {
        var ks = keys(cases), i = ks.indexOf(symbol) - 1;
        while (++i < ks.length) if (cases[ks[i]] !== '@next') { matched = cases[ks[i]]; break; }
      }
      if (isExec && isFun(matched)) {
        return len(matched) ? matched(source) : matched();
      } else {
        return matched === '@next' ? UDF : matched;
      }
    }
205321
function FiberFuture(fn, context, args) {
	this.fn = fn;
	this.context = context;
	this.args = args;
	this.started = false;
	var that = this;
	process.nextTick(function() {
		if (!that.started) {
			that.started = true;
			Fiber(function() {
				try {
					that.return(fn.apply(context, args));
				} catch(e) {
					that.throw(e);
				}
			}).run();
		}
	});
}
86795
function match(pid, pattern){ return function(process) {
  return toRegExp(pattern).test(process.name)
  &&     process.pid !== pid;
}}
273112
def match_check(self, regex, fun):
        '''
        
        '''
        vals = []
        if isinstance(fun, six.string_types):
            fun = [fun]
        for func in fun:
            try:
                if re.match(regex, func):
                    vals.append(True)
                else:
                    vals.append(False)
            except Exception:
                log.error('Invalid regular expression: %s', regex)
        return vals and all(vals)
958707
def _matchPattern(regExp, string):
        
        match = regExp.match(string)
        if match is not None and match.group(0):
            return match.group(0), (match.group(0), ) + match.groups()
        else:
            return None, None
976341
function match (filename, patterns, ignorePatterns) {
  function isMatch (ps) {
    return ps.some(p => {
      return mm.isMatch(filename, p, mmOptions)
    })
  }

  let isIgnore = false

  if (Array.isArray(ignorePatterns) && ignorePatterns.length) {
    isIgnore = isMatch(ignorePatterns)
  }

  if (isIgnore) {
    return false
  }

  return isMatch(patterns)
}
316165
function(matchFunction){
      if (this.matchFunction != matchFunction)
      {
        var oldMatchFunction = this.matchFunction;
        this.matchFunction = matchFunction;

        for (var node = this.lastChild; node; node = node.previousSibling)
          node.match(matchFunction);

        this.emit_matchFunctionChanged(oldMatchFunction);
      }
    }
281224
function tryFn1 (fn, arg, err) {
  try {
    err.err = null
    return fn(arg)
  } catch (e) {
    err.err = e
  }
}
11530
function (fn) {
            return function (response) {
                fn(response.status === "success" ? true : false, response.message, response.data);
            };
        }
1282390
protected static boolean matchesOne(String str, Pattern... patterns) {
        for (Pattern pattern : patterns) {
            if (pattern.matcher(str).matches()) {
                return true;
            }
        }
        return false;
    }
207529
function simple(matches, pattern, file) {
  var note = pattern.note
  var id = pattern.id
  var length = matches.length
  var index = -1
  var match
  var nodes

  while (++index < length) {
    match = matches[index]
    nodes = match.nodes

    warn(
      file,
      id,
      toString(nodes),
      pattern.considerate,
      nodes[0],
      note,
      pattern.condition
    )
  }
}