parse out bump/current version characters from version slot
491032
function verMatchVal(i) {
		var v = self.versionMatch[i];
		var vr = 0;
		var vl = self.prev.versionMatch && self.prev.versionMatch.length > i && self.prev.versionMatch[i] ? +self.prev.versionMatch[i]
				: vr;
		si++;
		// reset the last index so the tests will be accurate
		regexVerBump.lastIndex = 0;
		regexVerCurr.lastIndex = 0;
		if (v && regexVerBump.test(v)) {
			// increment the value for the given slot
			self.versionBumpedIndices.push(si);
			var bcnt = 0;
			v.replace(regexVerBump, function vBump(m) {
				bcnt += m.length;
			});
			vr = vl + bcnt;
		} else if (v && regexVerCurr.test(v)) {
			// use the last release value for the given slot
			self.versionPrevIndices.push(si);
			vr = vl;
		} else if (v) {
			// faster parseInt using unary operator
			vr = +v;
		}
		vt += vr;
		return vr;
	}
966949
def __parse_scanned_version_info(self):
        """"""
        string = self.sys_version_info_formatted
        try:
            major, minor, micro, release_level, serial = string.split(",")
            if (release_level in ("alfa", "beta", "candidate", "final") and
                    (release_level != "final" or serial == "0") and
                    major.isdigit() and  # --- --- --- --- --- --- --- --- ---
                    minor.isdigit() and  # Explicit isdigit() checks to detect
                    micro.isdigit() and  # leading/trailing whitespace.
                    serial.isdigit()):   # --- --- --- --- --- --- --- --- ---
                self.sys_version_info = (int(major), int(minor), int(micro),
                    release_level, int(serial))
                self.__construct_python_version()
                return
        except (KeyboardInterrupt, SystemExit):
            raise
        except Exception:
            pass
        raise BadEnvironment("Unsupported Python version (%s)" % (string,))
522484
def _get_version():
    
    with open('Lib/fontParts/__init__.py', 'r', encoding='utf-8') as f:
        for line in f:
            if line.startswith(u'__version__'):
                return ast.parse(line).body[0].value.s
        raise RuntimeError("No __version__ string found!")
7198
function toDrupalMajorVersion(version) {
    var regex = /^(\d+)\.\d+\.[x\d+]/;
    var match = version.match(regex)
    if (match) {
      return match[1] + '.x';
    }

    return version;
  }
1065315
private static Version parseVersion(String version) {
		String[] parts = version.split("\\.");
		int nbParts = parts.length;
		int majorIndex = nbParts > 1 ? 1 : 0;
		int major = Integer.parseInt(parts[majorIndex]);
		return new Version(major);
	}
1270750
def _extract_version(version_string, pattern):
    
    if version_string:
        match = pattern.match(version_string.strip())
        if match:
            return match.group(1)
    return ""
167688
def load_version_as_string():
    """"""
    with open(VERSION_PATH, 'r') as rfile:
        contents = rfile.read().strip()

    _, version = contents.split('=')
    version = version.strip()

    # Remove quotes
    return version.strip('"\'')
1010292
def versionstring():
    # type: () -> Text
    '''
    
    '''
    pkg = pkg_resources.require("cwltool")
    if pkg:
        return u"%s %s" % (sys.argv[0], pkg[0].version)
    return u"%s %s" % (sys.argv[0], "unknown version")
1028391
def version_parser(version_string):
    
    version, commit, branch = version_string.split('-', 3)

    # Remove the "v"
    version_number = version[1:]
    version_number = int(version_number)

    return Version(version_number, commit, branch)
205179
def parse_version(cls, version_str):
        
        match = cls.VERSION_RE.match(version_str)
        if match:
            major = int(match.group('major'))
            minor = int(match.group('minor'))
            flags = set(match.group('flags') or '')
        else:
            major, minor, flags = None, None, set()
        return cls(major, minor, flags)
979364
def current_version_option_validator(ctx, param, value):
    

    current_version = None

    if value:
        try:
            current_version = Version(value)
        except ValueError:
            ctx.fail(f"{value} is not a valid version string")

    # Look for the last git tag for the curren version
    git = Git()
    tag_pattern = ctx.params["tag_pattern"]
    versions = tag_analyzer(git.tags, tag_pattern, Version)

    # User provided current version. Try to find a tag that match it.
    if current_version:
        for version in versions:
            if version == current_version:
                current_version = version
                break
    elif versions:
        current_version = versions[0]

    ctx.params["current_tag"] = current_version.tag if current_version else None
    ctx.params["versions"] = versions

    return current_version
436495
def extractVersion(string, default='?'):
    
    return extract(VERSION_PATTERN, string, condense=True, default=default,
                   one=True)
884469
def get_current_version(self, increment=None):
		
		ver = (
			self.get_tagged_version()
			or str(self.get_next_version(increment)) + '.dev0'
		)
		return str(ver)
870911
function (version) {
        //var pattern = VERSION_PATTERN;
        var match = version.match(VERSION_PATTERN);
        if (match) {
            return [
                parseInt(match[1]),
                parseInt(match[2] || "0"),
                parseInt(match[3] || "0"),
                versionStageToInt(match[4]),
                parseInt(match[5] || "0"),
            ];
        }
        return null;
    }
895607
def bump_version(ctx, new_version, version_part=None, dry_run=False):
    """"""
    version_part = version_part or "minor"
    if dry_run:
        ctx = DryRunContext(ctx)
    ctx.run("bumpversion --new-version={} {}".format(new_version,
                                                      version_part))
1200153
def get_version():
        """"""
        cmd = [PostgresFinder.find_root() / 'pg_ctl', '--version']
        results = subprocess.check_output(cmd).decode('utf-8')
        match = re.search(r'(\d+\.\d+(\.\d+)?)', results)
        if match:
            ver_string = match.group(0)
            return tuple(int(x) for x in ver_string.split('.'))
706013
def _get_xml_version(element):
    """"""
    if "versions" in element.attrib:
        result = [ int(v) for v in re.split(",\s*", element.attrib["versions"]) ]
    else:
        result = [ 1 ]

    return result