syck_match_implicit
548644
public static String matchImplicit(Pointer ptr, int len) {
       String tag = "str";
       int cs;
       int act;
       int have = 0;
       int nread = 0;
       int p=ptr.start;
       int pe = p+len;
       int eof = p+len;
       int tokstart = -1;
       int tokend = -1;

       byte[] data = ptr.buffer;
       if(len == 0) {
         data = new byte[]{(byte)'~'};
         p = 0;
         pe = 1;
         eof = 1;
       }
              

// line 319 "src/main/org/yecht/ImplicitScanner2.java"
	{
	cs = ImplicitScanner_start;
	}
// line 104 "src/main/org/yecht/ImplicitScanner2.rl"


// line 326 "src/main/org/yecht/ImplicitScanner2.java"
	{
	int _klen;
	int _trans = 0;
	int _keys;
	int _goto_targ = 0;

	_goto: while (true) {
	switch ( _goto_targ ) {
	case 0:
	if ( p == pe ) {
		_goto_targ = 4;
		continue _goto;
	}
	if ( cs == 0 ) {
		_goto_targ = 5;
		continue _goto;
	}
case 1:
	_match: do {
	_keys = _ImplicitScanner_key_offsets[cs];
	_trans = _ImplicitScanner_index_offsets[cs];
	_klen = _ImplicitScanner_single_lengths[cs];
	if ( _klen > 0 ) {
		int _lower = _keys;
		int _mid;
		int _upper = _keys + _klen - 1;
		while (true) {
			if ( _upper < _lower )
				break;

			_mid = _lower + ((_upper-_lower) >> 1);
			if ( data[p] < _ImplicitScanner_trans_keys[_mid] )
				_upper = _mid - 1;
			else if ( data[p] > _ImplicitScanner_trans_keys[_mid] )
				_lower = _mid + 1;
			else {
				_trans += (_mid - _keys);
				break _match;
			}
		}
		_keys += _klen;
		_trans += _klen;
	}

	_klen = _ImplicitScanner_range_lengths[cs];
	if ( _klen > 0 ) {
		int _lower = _keys;
		int _mid;
		int _upper = _keys + (_klen<<1) - 2;
		while (true) {
			if ( _upper < _lower )
				break;

			_mid = _lower + (((_upper-_lower) >> 1) & ~1);
			if ( data[p] < _ImplicitScanner_trans_keys[_mid] )
				_upper = _mid - 2;
			else if ( data[p] > _ImplicitScanner_trans_keys[_mid+1] )
				_lower = _mid + 2;
			else {
				_trans += ((_mid - _keys)>>1);
				break _match;
			}
		}
		_trans += _klen;
	}
	} while (false);

	_trans = _ImplicitScanner_indicies[_trans];
	cs = _ImplicitScanner_trans_targs[_trans];

case 2:
	if ( cs == 0 ) {
		_goto_targ = 5;
		continue _goto;
	}
	if ( ++p != pe ) {
		_goto_targ = 1;
		continue _goto;
	}
case 4:
	if ( p == eof )
	{
	int __acts = _ImplicitScanner_eof_actions[cs];
	int __nacts = (int) _ImplicitScanner_actions[__acts++];
	while ( __nacts-- > 0 ) {
		switch ( _ImplicitScanner_actions[__acts++] ) {
	case 0:
// line 56 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "null";}
	break;
	case 1:
// line 57 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "bool#yes";}
	break;
	case 2:
// line 58 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "bool#no";}
	break;
	case 3:
// line 59 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "int#hex";}
	break;
	case 4:
// line 60 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "int#oct";}
	break;
	case 5:
// line 61 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "int#base60";}
	break;
	case 6:
// line 62 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "int";}
	break;
	case 7:
// line 63 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "float#fix";}
	break;
	case 8:
// line 64 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "float#exp";}
	break;
	case 9:
// line 65 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "float#base60";}
	break;
	case 10:
// line 66 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "float#inf";}
	break;
	case 11:
// line 67 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "float#neginf";}
	break;
	case 12:
// line 68 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "float#nan";}
	break;
	case 13:
// line 69 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "timestamp#ymd";}
	break;
	case 14:
// line 70 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "timestamp#iso8601";}
	break;
	case 15:
// line 71 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "timestamp#spaced";}
	break;
	case 16:
// line 72 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "timestamp";}
	break;
	case 17:
// line 73 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "default";}
	break;
	case 18:
// line 74 "src/main/org/yecht/ImplicitScanner2.rl"
	{tag = "merge";}
	break;
// line 489 "src/main/org/yecht/ImplicitScanner2.java"
		}
	}
	}

case 5:
	}
	break; }
	}
// line 106 "src/main/org/yecht/ImplicitScanner2.rl"

       return tag;
    }
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
647894
function match(str, patterns) {
    var matched = false;
    if (!_.is(patterns, 'Array')) {
      patterns = [patterns];
    }
    patterns.every(function(pattern) {
      if (!pattern) {
        return true;
      }
      matched = matched || str.search(normalize(pattern)) > -1;
      return !matched;
    });
    return matched;
  }
51449
public void match(ByteBuffer data, int size, IMtrieHandler func, XPub pub)
    {
        assert (data != null);
        assert (func != null);
        assert (pub != null);
        Mtrie current = this;
        int idx = 0;

        while (true) {
            //  Signal the pipes attached to this node.
            if (current.pipes != null) {
                for (Pipe it : current.pipes) {
                    func.invoke(it, null, 0, pub);
                }
            }

            //  If we are at the end of the message, there's nothing more to match.
            if (size == 0) {
                break;
            }

            //  If there are no subnodes in the trie, return.
            if (current.count == 0) {
                break;
            }

            byte c = data.get(idx);
            //  If there's one subnode (optimisation).
            if (current.count == 1) {
                if (c != current.min) {
                    break;
                }
                current = current.next[0];
                idx++;
                size--;
                continue;
            }

            //  If there are multiple subnodes.
            if (c < current.min || c >= current.min + current.count) {
                break;
            }
            if (current.next[c - current.min] == null) {
                break;
            }
            current = current.next[c - current.min];
            idx++;
            size--;
        }
    }
601270
def _fn_matches(fn, glob):
    """"""
    if glob not in _pattern_cache:
        pattern = _pattern_cache[glob] = re.compile(fnmatch.translate(glob))
        return pattern.match(fn)
    return _pattern_cache[glob].match(fn)
579234
Token match( TokenStream input,
                 int ttype,
                 String text,
                 int[] follow,
                 DroolsEditorType etype ) throws RecognitionException {
        Token matchedSymbol = null;
        matchedSymbol = input.LT(1);
        if (input.LA(1) == ttype && (text == null || text.equals(matchedSymbol.getText()))) {
            input.consume();
            state.errorRecovery = false;
            state.failed = false;
            helper.emit(matchedSymbol,
                    etype);
            return matchedSymbol;
        }
        if (state.backtracking > 0) {
            state.failed = true;
            return matchedSymbol;
        }
        matchedSymbol = recoverFromMismatchedToken(input,
                ttype,
                text,
                follow);
        helper.emit(matchedSymbol,
                etype);
        return matchedSymbol;
    }
45058
def _match_literal(self, a, b=None):
        """"""

        return a.lower() == b if not self.case_sensitive else a == b
703853
@Benchmark
  public void fizzBuzzPatternMatching() {
    IntStream.range(0, 101).forEach(
        n -> System.out.println(
            match(Tuple2.of(n % 3, n % 5))
                .when(tuple2(eq(0), eq(0))).get(() -> "FizzBuzz")
                .when(tuple2(eq(0), any())).get(y -> "Fizz")
                .when(tuple2(any(), eq(0))).get(x -> "Buzz")
                .orElse(String.valueOf(n))
                .getMatch()
        )
    );
  }
626682
def match_string(self, stype):
        """"""

        return not (stype - self.string_types) or bool(stype & self.wild_string_types)
935742
def match_value_by_name(expected_type, actual_value):
        
        if expected_type == None:
            return True
        if actual_value == None:
            raise Exception("Actual value cannot be null")

        return TypeMatcher.match_type_by_name(expected_type, type(actual_value))
682911
def match_unit(data, p, m='a'):
    """"""
    if data is None:
        return p is None

    # compile search value only once for non exact search
    if m != 'e' and isinstance(p, six.string_types):
        p = re.compile(p)

    if isinstance(data, Sequence) and not isinstance(data, six.string_types):
        return any([match_unit(field, p, m=m)
                    for field in data])
    elif isinstance(data, MutableMapping):
        return any([match_unit(field, p, m=m)
                    for field in data.values()])

    # Inclusive range query
    if isinstance(p, tuple):
        left, right = p
        return (left <= data) and (data <= right)

    if m == 'e':
        return six.text_type(data) == p
    return p.search(six.text_type(data)) is not None
976031
def matches(value, pattern):
    
    # types must match exactly
    if type(value) != type(pattern):
        return False

    # primitive value, such as None, True, False etc
    if not isinstance(value, ast.AST) and not isinstance(pattern, ast.AST):
        return value == pattern

    fields = [
        (field, getattr(pattern, field))
        for field in pattern._fields
        if hasattr(pattern, field)
    ]
    for field_name, field_value in fields:
        if not matches(getattr(value, field_name), field_value):
            return False
    return True
480126
def match(self, context, line):
		""""""
		
		return line.kind == 'code' and line.partitioned[0] in self._both
508391
def match(self, category, pattern):
        """"""

        return fnmatch.fnmatch(category, pattern, flags=self.FNMATCH_FLAGS)
574539
function match(args, typeMap) {
  // No arguments, no win.
  if (!args || !args.length) {
    throw new Error('Cannot perform overload.match: args must be non-null array');
  } else if (!typeMap || !typeMap.length) {
    // We always satisfy a null or empty typeMap
    return true;
  }

  // Validate the arguments one by one
  for (let index = 0; index < args.length; index++) {
    if (!compatible(args[index], typeMap[index])) {
      return false;
    }
  }

  // If not incompatible, sucess
  return true;
}
1104213
def _match_excluded(self, filename, patterns):
        """"""

        return _wcparse._match_real(
            filename, patterns._include, patterns._exclude, patterns._follow, self.symlinks
        )
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)
}