map of tag => version
4315
protected IPromise<JsonObject> getDistributions(String module) {
        Promise res = new Promise();
//        http://registry.npmjs.org/-/package/react/dist-tags
        http.getContent(config.getRepo()+"/-/package/"+module+"/dist-tags").then( (cont,err) -> {
            if ( cont != null ) {
                JsonObject parse = Json.parse(cont).asObject();
                res.resolve(parse);
            } else {
                res.reject(err);
            }
        });
        return res;
    }
219447
def version(*names, **kwargs):
    '''
    
    '''
    ret = {}
    versions_as_list = \
        salt.utils.data.is_true(kwargs.pop('versions_as_list', False))
    pkg_glob = False
    if names:
        pkgs = __salt__['pkg.list_pkgs'](versions_as_list=True, **kwargs)
        for name in names:
            if '*' in name:
                pkg_glob = True
                for match in fnmatch.filter(pkgs, name):
                    ret[match] = pkgs.get(match, [])
            else:
                ret[name] = pkgs.get(name, [])
    if not versions_as_list:
        __salt__['pkg_resource.stringify'](ret)
    # Return a string if no globbing is used, and there is one item in the
    # return dict
    if len(ret) == 1 and not pkg_glob:
        try:
            return next(six.itervalues(ret))
        except StopIteration:
            return ''
    return ret
1304683
def create_tag(version: Union[Version, str], tag_format: Optional[str] = None):
    
    if isinstance(version, str):
        version = Version(version)

    if not tag_format:
        return version.public

    major, minor, patch = version.release
    prerelease = ""
    if version.is_prerelease:
        prerelease = f"{version.pre[0]}{version.pre[1]}"

    t = Template(tag_format)
    return t.safe_substitute(
        version=version, major=major, minor=minor, patch=patch, prerelease=prerelease
    )
129048
def validate_version(self, prefix='v'):
        
        version = self.software_version()
        repo = self.github_repo()
        repo.releases.validate_tag(version, prefix)
        return version
127536
def get_version(*args):
    """"""
    contents = get_contents(*args)
    metadata = dict(re.findall('__([a-z]+)__ = [\'"]([^\'"]+)', contents))
    return metadata['version']
762234
function tagRepo(version) {
    if (SHOULD_PUBLISH) {
        shell.exec(`git tag ${version}`);
        shell.exec("git push origin --tags");
    } else {
        console.log(`\n\nWould publish git tag as version ${version}.`);
    }
}
771895
function getVersionSCXML(machineName, versionKey) {
        let route = getVersionModelRoute(machineName, versionKey);
        return fs.readFileSync(repositoryPath + "/" + route).toString('utf8');
    }
479896
def tag_versions(repo_path):
    
    repo = dulwich.repo.Repo(repo_path)
    tags = get_tags(repo)
    maj_version = 0
    feat_version = 0
    fix_version = 0
    last_maj_version = 0
    last_feat_version = 0
    result = []

    for commit_sha, children in reversed(
            get_children_per_first_parent(repo_path).items()
    ):
        commit = get_repo_object(repo, commit_sha)
        maj_version, feat_version, fix_version = get_version(
            commit=commit,
            tags=tags,
            maj_version=maj_version,
            feat_version=feat_version,
            fix_version=fix_version,
            children=children,
        )
        if (
            last_maj_version != maj_version or
            last_feat_version != feat_version
        ):
            last_maj_version = maj_version
            last_feat_version = feat_version
            tag_name = 'refs/tags/v%d.%d' % (maj_version, feat_version)
            if ON_PYTHON3:
                repo[str.encode(tag_name)] = commit
            else:
                repo[tag_name] = commit

            result.append(
                'v%d.%d -> %s' % (maj_version, feat_version, commit_sha)
            )

    return '\n'.join(result)
1327881
function ( version, options ){
			
		var matches;
		
		//First if version is 'readme' or 'plugin' version values
		if( version === 'readme' ){
			var readme = grunt.file.read( options.readme );
			matches = readme.match( new RegExp("^Stable tag:\\s*(\\S+)","im") );
			
			if( matches.length <= 1 ){
				grunt.fail.fatal( 'Could not find version in "' + options.readme + '"' );
			}
			version = matches[1];
		
		}else if( version === 'plugin' ){
			var plugin = grunt.file.read( options.plugin );
			matches = plugin.match( new RegExp("^[\* ]*Version:\\s*(\\S+)","im") );
			if( matches.length <= 1 ){
				grunt.fail.fatal( 'Could not find version in "' + options.readme + '"' );
			}
			version = matches[1];
		}
		
		return version;
	}
86357
def get_tag_version(nrml_node):
    
    version, tag = re.search(r'(nrml/[\d\.]+)\}(\w+)', nrml_node.tag).groups()
    return tag, version
737205
function getNewVersions() {
  return getTags()
    .then(tags => {
      var newVersions = []
      for(tag of tags) {
        if (semver.gt(tag.name, update.latest) || (
            semver.eq(tag.name, update.latest) && (semver(tag.name).build[0] || 0) > (semver(update.latest).build[0] || 0)
          )) {
          newVersions.push(tag)
        }
      }
      newVersions.reverse()
      // order versions from lower to greater
      console.log(chalk.blue('New versions available: ' + (newVersions.map(v => v.name).join(', ') || 'none') + '.'))
      return newVersions
    })
    .catch(e => console.log(e.stack))
}
351808
function (browsers, userAgent) {
      return detect(browsers, userAgent).map(function (browser) {
        var version = Version.detect(browser.versionRegexes, userAgent);
        return {
          current: browser.name,
          version: version
        };
      });
    }
1062677
function generateVersionsTooltip(versions) {
    return versions.map(function(lib) {
      return lib.name + " " + lib.version;
    }).join("\n");
  }
1174647
def version_str(self):
        
        vs = str(self.release)
        if self.tag is not None:
            vs += '@{t}'.format(t=self.tag)
        elif self.commit is not None:
            vs += '@{c}'.format(c=self.commit)
        return vs
1138696
def get_version_tuple(string):
    ''''''
    match = re.match(r'(\d+)\.(\d+)\.?(\d*)([abc]?)(\d*)', string)
    major = int(match.group(1))
    minor = int(match.group(2))
    patch = int(match.group(3) or 0)
    level = RELEASE_LEVEL_MAP.get(match.group(4), 'final')
    serial = int(match.group(5) or 0)

    return major, minor, patch, level, serial
632448
def _get_last_tag(self):
        

        current_version = LooseVersion(
            self._get_version_from_tag(self.release_notes_generator.current_tag)
        )

        versions = []
        for tag in self.repo.tags():
            if not tag.name.startswith(self.github_info["prefix_prod"]):
                continue
            version = LooseVersion(self._get_version_from_tag(tag.name))
            if version >= current_version:
                continue
            versions.append(version)
        if versions:
            versions.sort()
            return "{}{}".format(self.github_info["prefix_prod"], versions[-1])
1090737
def validate_condition!(condition, tag)
      tag = VersionString.new(tag)
      tag.validate!("The version condition, #{condition}, is not valid!")
      tag
    end