Check whether `value` matches `pattern`.

    Parameters
    ----------
    value : ast.AST
    pattern : ast.AST

    Returns
    -------
    matched : bool
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
671548
def checkValue(self,value,strict=0):
        
        v = self._coerceValue(value,strict)
        return self.checkOneValue(v,strict)
1298370
def fnmatches(entry, *pattern_list):
    

    for pattern in pattern_list:
        if pattern and fnmatch(entry, pattern):
            return True
    return False
649643
def match(pattern, data, **parse_kwargs):
    """"""
    return [m.value for m in parse(pattern, **parse_kwargs).find(data)]
597202
def match(self, item):
        
        if self._position == len(self._matchers):
            raise RuntimeError('Matcher exhausted, no more matchers to use')

        matcher = self._matchers[self._position]
        if matcher(item):
            self._position += 1

        if self._position == len(self._matchers):
            # All patterns have been matched
            return True

        return False
800330
def matches(self, hash_alg, hash_value):
        
        return self.alg == hash_alg and self.value == hash_value
515829
def run(self, value):
        
        if self.pass_ and not value.strip():
            return True

        if (value.strip() if self.strip else value) not in self.given_list:
            self.error = self.error.format(value)
            return False
        return True
495681
def check_match(self, name):
        
        return any(pattern.match(name) for pattern in self.patterns)
759081
def value_contains(self, value, attribute):
        
        for item in self[attribute]:
            if value in item:
                return True
        return False
916882
def match(self, item):
        
        if 0 and getattr(item, self._name):
            print "%r %r %r %r %r %r" % (self._cmp(float(getattr(item, self._name)), self._value),
                  self._name, self._condition, item.name, getattr(item, self._name), self._value)
        val = getattr(item, self._name) or 0
        if self.not_null and self._value and not val:
            return False
        else:
            return self._cmp(float(val), self._value)
1175474
private static boolean samePattern(String value1, String value2) {
        if (value1.length() == 0) {
            return value2.length() == 0;
        }
        if (value1.charAt(0) == '{') {
            return value2.length() > 0 && value2.charAt(0) == '{';
        }
        return value1.equals(value2);
    }
1214992
public static boolean matches(final Pattern pattern, final String value, final boolean completeMatch) {
        val matcher = pattern.matcher(value);
        LOGGER.debug("Matching value [{}] against pattern [{}]", value, pattern.pattern());
        if (completeMatch) {
            return matcher.matches();
        }
        return matcher.find();
    }
362046
def validate(self, value):
        
        for validate in self.validates:
            value = validate(value)
        return value
529731
def match(pattern):
    
    regex = re.compile(pattern)

    def validate(value):
        if not regex.match(value):
            return e("{} does not match the pattern {}", value, pattern)
    return validate
1332178
private static boolean isMatch(List<ValueMatcher> matchers, int index, int value) {
		return (matchers.size() > index) ? matchers.get(index).match(value) : true;
	}
706295
protected boolean check(String value, String regex) {
		Pattern pattern = Pattern.compile(regex);
		return pattern.matcher(value).matches();
	}
424162
public <T> void checkThat(final T value, final Matcher<T> matcher) {
        checkThat("", value, matcher);
    }