Check if a release version matches any of the specificed patterns.

        Parameters
        ==========
        name: str
            Release name

        Returns
        =======
        bool:
            True if it matches, False otherwise.
495681
def check_match(self, name):
        
        return any(pattern.match(name) for pattern in self.patterns)
233089
def recognized_release(self):
        
        _, _, rest = self.get_release_parts()
        # If "rest" is not a well-known value here, then this package is
        # using a Release value pattern we cannot recognize.
        if rest == '' or re.match(r'%{\??dist}', rest):
            return True
        return False
1014658
def get_version(string):
    
    flags = re.S
    pattern = r".*__version__ = '(.*?)'"
    match = re.match(pattern=pattern, string=string, flags=flags)

    if match:
        return match.group(1)

    raise RuntimeError('No version string could be matched')
76269
protected boolean hasValidVersionSpecified( EnforcerRuleHelper helper, Plugin source, List<PluginWrapper> pluginWrappers )
    {
        boolean found = false;
        boolean status = false;
        for ( PluginWrapper plugin : pluginWrappers )
        {
            // find the matching plugin entry
            if ( source.getArtifactId().equals( plugin.getArtifactId() )
                && source.getGroupId().equals( plugin.getGroupId() ) )
            {
                found = true;
                // found the entry. now see if the version is specified
                String version = plugin.getVersion();
                try
                {
                    version = (String) helper.evaluate( version );
                }
                catch ( ExpressionEvaluationException e )
                {
                    return false;
                }

                if ( StringUtils.isNotEmpty( version ) && !StringUtils.isWhitespace( version ) )
                {

                    if ( banRelease && version.equals( "RELEASE" ) )
                    {
                        return false;
                    }

                    if ( banLatest && version.equals( "LATEST" ) )
                    {
                        return false;
                    }

                    if ( banSnapshots && isSnapshot( version ) )
                    {
                        return false;
                    }
                    // the version was specified and not
                    // banned. It's ok. Keep looking through the list to make
                    // sure it's not using a banned version somewhere else.

                    status = true;

                    if ( !banRelease && !banLatest && !banSnapshots )
                    {
                        // no need to keep looking
                        break;
                    }
                }
            }
        }
        if ( !found )
        {
            log.debug( "plugin " + source.getGroupId() + ":" + source.getArtifactId() + " not found" );
        }
        return status;
    }
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
767182
def filename_match(filename, patterns, default=True):
    
    if not patterns:
        return default
    return any(fnmatch(filename, pattern) for pattern in patterns)
530377
def is_match(self, command):
        
        if command.output is None and self.requires_output:
            return False

        try:
            with logs.debug_time(u'Trying rule: {};'.format(self.name)):
                if self.match(command):
                    return True
        except Exception:
            logs.rule_failed(self, sys.exc_info())
1309507
def version_classifier(version_str):
    
    # cast version
    version = LooseVersion(version_str)

    for (test_ver, classifier) in reversed(sorted(VERSION_CLASSIFIER_MAP, key=lambda x: x[0])):
        if version >= test_ver:
            return classifier

    raise ValueError("could not find valid 'Development Status' classifier for v{}".format(version_str))
1196289
def find_version(filename):
    
    import re
    content = read(filename)
    version_match = re.search(
        r"^__version__ = ['\"]([^'\"]*)['\"]", content, re.M
    )
    if version_match:
        return version_match.group(1)
    raise RuntimeError('Unable to find version string.')
732493
def python_version_matchers():
    """"""
    version = sys.version_info
    patterns = [
        "{0}",
        "{0}{1}",
        "{0}.{1}",
    ]
    matchers = [
        pattern.format(*version)
        for pattern in patterns
    ] + [None]
    return set(matchers)
731689
def filter(self, info, releases):
        
        for version in list(releases.keys()):
            if any(pattern.match(version) for pattern in self.patterns):
                del releases[version]
719137
def should_be_excluded(name, exclude_patterns):
    
    for pattern in exclude_patterns:
        if fnmatch.fnmatch(name, pattern):
            return True
    return False
598278
def get_release_info(self, name, version):  # type: (str, str) -> dict
        
        if self._disable_cache:
            return self._get_release_info(name, version)

        cached = self._cache.remember_forever(
            "{}:{}".format(name, version), lambda: self._get_release_info(name, version)
        )

        cache_version = cached.get("_cache_version", "0.0.0")
        if parse_constraint(cache_version) != self.CACHE_VERSION:
            # The cache must be updated
            self._log(
                "The cache for {} {} is outdated. Refreshing.".format(name, version),
                level="debug",
            )
            cached = self._get_release_info(name, version)

            self._cache.forever("{}:{}".format(name, version), cached)

        return cached
275718
def ismatch(self, s):
        
        if self._ismatchfun(s) and self._compiled_pattern.match(s):
            return True
        return False
1058591
def filename_match(filename):
    
    if not options.filename:
        return True
    for pattern in options.filename:
        if fnmatch(filename, pattern):
            return True
143751
def is_canonical(version, loosedev=False):  # type: (str, bool) -> bool
    
    if loosedev:
        return loose440re.match(version) is not None
    return pep440re.match(version) is not None
669204
static boolean hasUpdate(final String newer, final String older) {
		return VERSION_PATTERN.matcher(newer).matches() && VERSION_PATTERN.matcher(older).matches() ? newer.compareTo(older) > 0 : false;
	}