@param version: version number or 'dev' for svn
        @type version: string

        @param source: download source or egg
        @type source: boolean

        @returns: None
353649
def print_download_uri(self, version, source):
        

        if version == "dev":
            pkg_type = "subversion"
            source = True
        elif source:
            pkg_type = "source"
        else:
            pkg_type = "egg"

        #Use setuptools monkey-patch to grab url
        url = get_download_uri(self.project_name, version, source,
                self.options.pypi_index)
        if url:
            print("%s" % url)
        else:
            self.logger.info("No download URL found for %s" % pkg_type)
745170
private static Version extractVersion() {
		VersionInfo versionInfo = VersionInfo.getVersionInfo();
		String versionString = versionInfo.getVersion();
		String[] splits = versionString.split("\\.");
		int major = 0;
		int minor = 0;
		int patch = 0;
		int build = 0;
		try {
			major = Integer.parseInt(splits[0]);
			minor = Integer.parseInt(splits[1]);
			patch = Integer.parseInt(splits[2]);
			build = Integer.parseInt(splits[3]);
		} catch (Exception ignored) {

		}
		return new Version(major, minor, patch, build);
	}
65318
def find_version_by_regex(
    file_source, version_token="__version__"
):  # type: (str,str)->Optional[str]
    
    if not file_source:
        return None
    version_match = re.search(
        r"^" + version_token + r" = ['\"]([^'\"]*)['\"]", file_source, re.M
    )
    if version_match:
        candidate = version_match.group(1)
        if candidate == "" or candidate == ".":  # yes, it will match to a .
            return None
        return candidate
    return None
886382
def get_version_by_version_id(version_id):
    
    for ver in registry.version_info:
        if ver.version_id == version_id:
            return ver.id

    return None
1053722
public static ESVersion fromString(String version) {
        String lVersion = version;
        final boolean snapshot = lVersion.endsWith("-SNAPSHOT");
        if (snapshot) {
            lVersion = lVersion.substring(0, lVersion.length() - 9);
        }
        String[] parts = lVersion.split("[.-]");
        if (parts.length < 3 || parts.length > 4) {
            throw new IllegalArgumentException(
                    "the lVersion needs to contain major, minor, and revision, and optionally the build: " + lVersion);
        }

        try {
            final int rawMajor = Integer.parseInt(parts[0]);
            if (rawMajor >= 5 && snapshot) { // we don't support snapshot as part of the lVersion here anymore
                throw new IllegalArgumentException("illegal lVersion format - snapshots are only supported until lVersion 2.x");
            }
            final int betaOffset = rawMajor < 5 ? 0 : 25;
            //we reverse the lVersion id calculation based on some assumption as we can't reliably reverse the modulo
            final int major = rawMajor * 1000000;
            final int minor = Integer.parseInt(parts[1]) * 10000;
            final int revision = Integer.parseInt(parts[2]) * 100;


            int build = 99;
            if (parts.length == 4) {
                String buildStr = parts[3];
                if (buildStr.startsWith("alpha")) {
                    assert rawMajor >= 5 : "major must be >= 5 but was " + major;
                    build = Integer.parseInt(buildStr.substring(5));
                    assert build < 25 : "expected a beta build but " + build + " >= 25";
                } else if (buildStr.startsWith("Beta") || buildStr.startsWith("beta")) {
                    build = betaOffset + Integer.parseInt(buildStr.substring(4));
                    assert build < 50 : "expected a beta build but " + build + " >= 50";
                } else if (buildStr.startsWith("RC") || buildStr.startsWith("rc")) {
                    build = Integer.parseInt(buildStr.substring(2)) + 50;
                } else {
                    throw new IllegalArgumentException("unable to parse lVersion " + lVersion);
                }
            }

            return new ESVersion(major + minor + revision + build);

        } catch (NumberFormatException e) {
            throw new IllegalArgumentException("unable to parse lVersion " + lVersion, e);
        }
    }
312142
boolean documentVersion(String version) {
    if (!lazyInitDocumentation()) {
      return true;
    }

    if (documentation.version != null) {
      return false;
    }

    documentation.version = version;
    return true;
  }
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);
	}
133913
def _get_version(name, results):
    '''
    
    '''
    for line in salt.utils.itertools.split(results, '\n'):
        if not line:
            continue
        try:
            pkgname, pkgver = line.rsplit('-', 1)
        except ValueError:
            continue
        if pkgname == name:
            return pkgver
    return None
54384
def version
      response = get('/getVersion', {}, false)
      ApiVersion.new(response.body['version'], response.body['builddate'])
    end
1093733
public void setVersion(String version)
    {
        if (_state!=__MSG_EDITABLE)
            throw new IllegalStateException("Not EDITABLE");
        if (version.equalsIgnoreCase(__HTTP_1_1))
        {
            _dotVersion=1;
            _version=__HTTP_1_1;
        }
        else if (version.equalsIgnoreCase(__HTTP_1_0))
        {
            _dotVersion=0;
            _version=__HTTP_1_0;
        }
        else if (version.equalsIgnoreCase(__HTTP_0_9))
        {
            _dotVersion=-1;
            _version=__HTTP_0_9;
        }
        else
            throw new IllegalArgumentException("Unknown version");
    }
1309048
def do_version(self, cluster=None):
        
        if not cluster:
            if not self.has_cluster():
                return None
            else:
                cluster = api.get_cluster(self.cluster)
        else:
            try:
                cluster = api.get_cluster(cluster)
            except ApiException:
                print("Error: Cluster not found")
                return None

        print("Version: %s" % (cluster.version))
952000
def _get_version(self, root):
        
        # Note: STIX and MAEC use a "version" attribute. To support CybOX, a
        # subclass will need to combine "cybox_major_version",
        # "cybox_minor_version", and "cybox_update_version".
        version = self.get_version(root)
        if version:
            return StrictVersion(version)

        raise UnknownVersionError(
            "Unable to determine the version of the input document. No "
            "version information found on the root element."
        )
341011
public void setVersion(int version)
    {
        if (version < 0 || 255 < version)
        {
            throw new IllegalArgumentException("'version' is out of the valid range: " + version);
        }

        mVersion = version;

        getData()[VERSION_INDEX] = (byte)(version & 0xFF);
    }
771895
function getVersionSCXML(machineName, versionKey) {
        let route = getVersionModelRoute(machineName, versionKey);
        return fs.readFileSync(repositoryPath + "/" + route).toString('utf8');
    }
32831
def update_version(self, version: Union[http.HttpVersion, str]) -> None:
        
        if isinstance(version, str):
            v = [l.strip() for l in version.split('.', 1)]
            try:
                version = http.HttpVersion(int(v[0]), int(v[1]))
            except ValueError:
                raise ValueError(
                    'Can not parse http version number: {}'
                    .format(version)) from None
        self.version = version
406726
public Version parseVersion(final String version) {
    checkNotNull(version);
    try {
      return versionScheme.parseVersion(version);
    }
    catch (InvalidVersionSpecificationException e) {
      throw Throwables.propagate(e);
    }
  }
830007
def set_version(self, version):
        
        self.parser.add_argument(
            "--version",
            action="version",
            version="%(prog)s {} (core {})".format(
                version, devpipeline_core.version.STRING
            ),
        )