Returns the release for a specified product with the same
        channel and major version with the highest minor version,
        or None if no such releases exist
507007
def equivalent_release_for_product(self, product):
        
        releases = self._default_manager.filter(
            version__startswith=self.major_version() + '.',
            channel=self.channel, product=product).order_by('-version')
        if not getattr(settings, 'DEV', False):
            releases = releases.filter(is_public=True)
        if releases:
            return sorted(
                sorted(releases, reverse=True,
                       key=lambda r: len(r.version.split('.'))),
                reverse=True, key=lambda r: r.version.split('.')[1])[0]
997688
def check_release_number(release):
    
    try:
        release = int(release)
    except:
        raise ValueError("Invalid Ensembl release: %s" % release)

    if release < MIN_ENSEMBL_RELEASE or release > MAX_ENSEMBL_RELEASE:
        raise ValueError(
            "Invalid Ensembl releases %d, must be between %d and %d" % (
                release, MIN_ENSEMBL_RELEASE, MAX_ENSEMBL_RELEASE))
    return release
423527
public static function getDifference(Release $release1, Release $release2 = null)
    {
        if ($release2 === null) {
            return self::MAJOR;
        }

        $version1 = explode('.', $release1->getVersion());
        $version2 = explode('.', $release2->getVersion());
        if (isset($version1[0]) === false || isset($version2[0]) === false || $version1[0] != $version2[0]) {
            return self::MAJOR;
        } elseif (isset($version1[1]) === false || isset($version2[1]) === false || $version1[1] != $version2[1]) {
            return self::MINOR;
        } elseif (isset($version1[2]) === false || isset($version2[2]) === false || $version1[2] != $version2[2]) {
            return self::PATCH;
        }
    }
95379
def parse_release_id(release_id):
    
    if "@" in release_id:
        release, base_product = release_id.split("@")
    else:
        release = release_id
        base_product = None

    result = _parse_release_id_part(release)
    if base_product is not None:
        result.update(_parse_release_id_part(base_product, prefix="bp_"))
    return result
415397
def productinfo(self):
        """"""
        if not self.mardata.additional:
            return None

        for s in self.mardata.additional.sections:
            if s.id == 1:
                return str(s.productversion), str(s.channel)

        return None
480598
def _cmp_version(item1, item2):
    '''
    
    '''
    vers1 = _LooseVersion(item1)
    vers2 = _LooseVersion(item2)

    if vers1 < vers2:
        return -1
    if vers1 > vers2:
        return 1
    return 0
87733
def minor_releases(self, manager):
        
        # TODO: yea deffo need a real object for 'manager', heh. E.g. we do a
        # very similar test for "do you have any actual releases yet?"
        # elsewhere. (This may be fodder for changing how we roll up
        # pre-major-release features though...?)
        return [
            key for key, value in six.iteritems(manager)
            if any(x for x in value if not x.startswith('unreleased'))
        ]
603855
def add_release(self, release):
        
        for r in self.releases:
            if r.version == release.version:
                return
        self.releases.append(release)
728424
def pre_release(self):
        
        label = self.version_info.get('label', None)
        pre = self.version_info.get('pre', None)

        return True if (label is not None and pre is not None) else False
953449
def find_release(package, releases, dependencies=None):
    """"""
    dependencies = dependencies if dependencies is not None else {}
    for release in releases:
        url = release['url']
        old_priority = dependencies.get(package, {}).get('priority', 0)

        for suffix, priority in SUFFIXES.items():
            if url.endswith(suffix):
                if old_priority < priority:
                    sha256 = release['digests']['sha256']
                    dependencies[package] = {
                        'package': package,
                        'url': url,
                        'sha256': sha256,
                        'priority': priority,
                    }

    return dependencies[package]
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))
1223051
def get_version(release_level=True):
    
    vers = ["%(major)i.%(minor)i.%(micro)i" % __version_info__]
    if release_level and __version_info__['releaselevel'] != 'final':
        vers.append('%(releaselevel)s%(serial)i' % __version_info__)
    return ''.join(vers)
203199
function hasEmberVersion(major, minor) {
  const numbers = VERSION.split('-')[0].split('.');
  const actualMajor = parseInt(numbers[0], 10);
  const actualMinor = parseInt(numbers[1], 10);
  return actualMajor > major || (actualMajor === major && actualMinor >= minor);
}
397354
def get_version():
    
    major_value = ctypes.c_int(0)
    major = ctypes.pointer(major_value)
    minor_value = ctypes.c_int(0)
    minor = ctypes.pointer(minor_value)
    rev_value = ctypes.c_int(0)
    rev = ctypes.pointer(rev_value)
    _glfw.glfwGetVersion(major, minor, rev)
    return major_value.value, minor_value.value, rev_value.value
1343458
def version(self, pretty=False, best=False):
        
        versions = [
            self.os_release_attr('version_id'),
            self.lsb_release_attr('release'),
            self.distro_release_attr('version_id'),
            self._parse_distro_release_content(
                self.os_release_attr('pretty_name')).get('version_id', ''),
            self._parse_distro_release_content(
                self.lsb_release_attr('description')).get('version_id', ''),
            self.uname_attr('release')
        ]
        version = ''
        if best:
            # This algorithm uses the last version in priority order that has
            # the best precision. If the versions are not in conflict, that
            # does not matter; otherwise, using the last one instead of the
            # first one might be considered a surprise.
            for v in versions:
                if v.count(".") > version.count(".") or version == '':
                    version = v
        else:
            for v in versions:
                if v != '':
                    version = v
                    break
        if pretty and version and self.codename():
            version = u'{0} ({1})'.format(version, self.codename())
        return version
1234227
function maxPrerelease (versions, prerelease) {
  return first(desc(versions), function (version) {
    return isPrerelease(version, prerelease);
  });
}
1289277
function buildRelease() {
  var version = getVersion(), run = true;
  if (!version.match(/^\d.\d+\.\d+$/)) {
    warn('Release requires a valid x.x.x version!');
    run = false;
  }
  if (!run) process.exit();
  return mergeStreams([
    buildDevelopment(),
    buildMinified(),
    buildPackagesDefault()
  ]);
}