Get the current version on GitHub
    `url` looks like 'https://raw.githubusercontent.com/aquatix/ns-notifications/master/VERSION'
349087
def get_repo_version(url):
    
    response = requests.get(url)
    if response.status_code == 404:
        return None
    else:
        return response.text.replace('\n', '')
1326334
def _get_version_from_url(self, url):
        '''
        
        '''
        regex = re.compile(r"^https?:\/\/.*\/(v[0-9])(\.[0-9])?(\/)?$")
        try:
            ver = regex.match(url)
            if ver.group(1):
                retver = ver.group(1)
                if ver.group(2):
                    retver = retver + ver.group(2)
            return retver
        except AttributeError:
            return ''
230248
def binder_spec_from_github_url(github_url):
    
    tokens = re.split(r'/|:', github_url.replace('.git', ''))
    # The username and reponame are the last two tokens
    return '{}/{}/master'.format(tokens[-2], tokens[-1])
772005
def do_version():
    """"""
    v = ApiPool.ping.model.Version(
        name=ApiPool().current_server_name,
        version=ApiPool().current_server_api.get_version(),
        container=get_container_version(),
    )
    log.info("/version: " + pprint.pformat(v))
    return v
100287
def get_previous_version(self):
        """"""
        gh = self.get_github_api()
        repo = gh.repository(self.repo_owner, self.repo_name)
        most_recent = None
        for release in repo.releases():
            # Return the second release that matches the release prefix
            if release.tag_name.startswith(self.project__git__prefix_release):
                if most_recent is None:
                    most_recent = release
                else:
                    return LooseVersion(self.get_version_for_tag(release.tag_name))
599939
def current_version_string():
    """"""
    return "{0}.{1}.{2}".format(sys.version_info.major,
                                sys.version_info.minor,
                                sys.version_info.micro)
1281906
def version(request):
    
    version_json = import_string(version_callback)(settings.BASE_DIR)
    if version_json is None:
        return HttpResponseNotFound('version.json not found')
    else:
        return JsonResponse(version_json)
603483
def fetch_version
      output = `DEVELOPER_DIR='' "#{@path}/Contents/Developer/usr/bin/xcodebuild" -version`
      return '0.0' if output.nil? || output.empty? # ¯\_(ツ)_/¯
      output.split("\n").first.split(' ')[1]
    end
652970
def get_version(version):
    ""
    assert len(version) == 5
    assert version[3] in ('alpha', 'beta', 'rc', 'final')
    parts = 2 if version[2] == 0 else 3
    main = '.'.join(map(str, version[:parts]))
    sub = ''
    if version[3] == 'alpha' and version[4] == 0:
        git_changeset = get_git_changeset()
        if git_changeset:
            sub = '.dev%s' % git_changeset
    elif version[3] != 'final':
        mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'}
        sub = mapping[version[3]] + str(version[4])
    return main + sub
117599
function calculateVersion(officialRelease, callback) {
    var version = require('./package.json').version;

    if (officialRelease) {
        callback(version);
    } else {
        git.short(function (str) {
            callback(version + '+' + str);
        });
    }
}
1341584
def get_version(package, url_pattern=URL_PATTERN):
    """"""
    req = requests.get(url_pattern.format(package=package))
    version = parse('0')
    if req.status_code == requests.codes.ok:
        # j = json.loads(req.text.encode(req.encoding))
        j = req.json()
        releases = j.get('releases', [])
        for release in releases:
            ver = parse(release)
            if not ver.is_prerelease:
                version = max(version, ver)
    return version
88469
def print_version():
    """"""
    click.echo("Versions:")
    click.secho(
        "CLI Package Version: %(version)s"
        % {"version": click.style(get_cli_version(), bold=True)}
    )
    click.secho(
        "API Package Version: %(version)s"
        % {"version": click.style(get_api_version(), bold=True)}
    )
550591
def get_git_version(cls):
        
        try:
            output = cls.run_git_shell('git version')
        except CalledProcessError:
            cls.LOG.warning("Unable to get Git version.")
            return None

        try:
            version = output.split()[2]
        except IndexError:
            cls.LOG.warning("Unable to parse Git version \"%s\".", output)
            return None

        try:
            return tuple(int(v) for v in version.split('.'))
        except ValueError:
            cls.LOG.warning("Unable to parse Git version \"%s\".", version)
            return None
605886
def check_version():
    
    import requests
    r = requests.get('https://pypi.python.org/pypi/intern/json').json()
    r = r['info']['version']
    if r != __version__:
        print("You are using version {}. A newer version of intern is available: {} ".format(__version__, r) +
              "\n\n'pip install -U intern' to update.")
    return r
996493
def _get_version():
    """"""
    with open("../waliki/__init__.py") as fh:
        for line in fh:
            if line.startswith("__version__ = "):
                return line.split("=")[-1].strip().strip("'").strip('"')
860917
function showVersion(){
  var jshint_proc = fork(__dirname + '/node_modules/jshint/bin/jshint', ['-v'], {silent: true});
  var ts = through(function write(chunk){
    this.queue("JSXHint v" + require('./package.json').version + " (" +
      chunk.toString().replace("\n", "") + ")\n");
  });
  jshint_proc.stderr.pipe(ts).pipe(process.stderr);
}
200267
def version_already_uploaded(project_name, version_str, index_url, requests_verify=True):
    
    all_versions = _get_uploaded_versions(project_name, index_url, requests_verify)
    return version_str in all_versions