Get a list of all APK version codes - returns the list of version codes
197235
def apks_version_codes
      ensure_active_edit!

      result = call_google_api { client.list_apks(current_package_name, current_edit.id) }

      return Array(result.apks).map(&:version_code)
    end
691320
def query_versions(self, version=None):
        """"""
        if version not in RELEASE_AND_CANDIDATE_LATEST_VERSIONS:
            return [version]

        url = urljoin(self.base_url, 'releases/')
        parser = self._create_directory_parser(url)
        if version:
            versions = parser.filter(RELEASE_AND_CANDIDATE_LATEST_VERSIONS[version])
            from distutils.version import LooseVersion
            versions.sort(key=LooseVersion)
            return [versions[-1]]
        else:
            return parser.entries
1287953
def list_pkgs(versions_as_list=False, **kwargs):
    '''
    
    '''
    ret = {}
    versions_as_list = salt.utils.data.is_true(versions_as_list)
    # not yet implemented or not applicable
    if any([salt.utils.data.is_true(kwargs.get(x))
            for x in ('removed', 'purge_desired')]):
        return ret

    if 'pkg.list_pkgs' in __context__:
        if versions_as_list:
            return __context__['pkg.list_pkgs']
        else:
            ret = copy.deepcopy(
                __context__['pkg.list_pkgs'])
            __salt__['pkg_resource.stringify'](ret)
            return ret

    # cmd returns information colon delimited in a single linei, format
    #   Package Name:Fileset:Level:State:PTF Id:Fix State:Type:Description:
    #       Destination Dir.:Uninstaller:Message Catalog:Message Set:
    #       Message Number:Parent:Automatic:EFIX Locked:Install Path:Build Date
    # Example:
    #   xcursor:xcursor-1.1.7-3:1.1.7-3: : :C:R:X Cursor library: :\
    #       /bin/rpm -e xcursor: : : : :0: :(none):Mon May  8 15:18:35 CDT 2017
    #   bos:bos.rte.libcur:7.1.5.0: : :C:F:libcurses Library: : : : : : :0:0:/:1731
    #
    # where Type codes: F -- Installp Fileset, P -- Product, C -- Component,
    #                   T -- Feature, R -- RPM Package
    cmd = '/usr/bin/lslpp -Lc'
    lines = __salt__['cmd.run'](
            cmd,
            python_shell=False).splitlines()

    for line in lines:
        if line.startswith('#'):
            continue

        comps = line.split(':')
        if len(comps) < 7:
            continue

        if 'R' in comps[6]:
            name = comps[0]
        else:
            name = comps[1]     # use fileset rather than rpm package

        version_num = comps[2]
        __salt__['pkg_resource.add_pkg'](
            ret,
            name,
            version_num)

    __salt__['pkg_resource.sort_pkglist'](ret)
    __context__['pkg.list_pkgs'] = copy.deepcopy(ret)

    if not versions_as_list:
        __salt__['pkg_resource.stringify'](ret)

    return ret
1261181
def get_package_versions(package):
    
    list_command = ListCommand()
    options, args = list_command.parse_args([])
    packages = [get_dist(package)]
    dists = list_command.iter_packages_latest_infos(packages, options)
    try:
        dist = next(dists)
        return dist.parsed_version, dist.latest_version
    except StopIteration:
        return None, None
732493
def python_version_matchers():
    """"""
    version = sys.version_info
    patterns = [
        "{0}",
        "{0}{1}",
        "{0}.{1}",
    ]
    matchers = [
        pattern.format(*version)
        for pattern in patterns
    ] + [None]
    return set(matchers)
992363
def post_versions_list(self, updater_name=None, updater_id=None,
                           post_id=None, start_id=None):
        
        params = {
            'search[updater_name]': updater_name,
            'search[updater_id]': updater_id,
            'search[post_id]': post_id,
            'search[start_id]': start_id
            }
        return self._get('post_versions.json', params)
350648
def list_installed():
    '''
    
    '''
    pkg_re = re.compile(r'^{0}-[\d.-]+-{1}$'.format(
        _package_prefix(), _kernel_type()))
    pkgs = __salt__['pkg.list_pkgs'](versions_as_list=True)
    if pkgs is None:
        pkgs = []

    result = list(filter(pkg_re.match, pkgs))
    if result is None:
        return []

    prefix_len = len(_package_prefix()) + 1

    if six.PY2:
        return sorted([pkg[prefix_len:] for pkg in result], cmp=_cmp_version)
    else:
        return sorted([pkg[prefix_len:] for pkg in result], key=functools.cmp_to_key(_cmp_version))
573587
def [](version)
      return versions.values.last unless version
      detected = versions.detect { |v,_| version.start_with?(v) }
      raise ArgumentError, 'unsupported version %p' % version unless detected
      detected.last
    end
490512
def pkg_version_list(self, pkg_id):
        '''
        
        '''
        pkg_data = self.__reg_software.get(pkg_id, None)
        if not pkg_data:
            return []

        if isinstance(pkg_data, list):
            # raw data is 'pkgid': [sorted version list]
            return pkg_data  # already sorted oldest to newest

        # Must be a dict or OrderDict, and contain full details
        installed_versions = list(pkg_data.get('version').keys())
        return sorted(installed_versions, key=cmp_to_key(self.__oldest_to_latest_version))
798646
function getVersions() {
  const paths = [
    getDestPackageFile('ngd3'),
  ];

  return paths
    .map(path => require(path))
    .map(pkgs => pkgs.version);
}
693390
def get_gae_versions():
    """"""
    r = requests.get(SDK_RELEASES_URL)
    r.raise_for_status()

    releases = r.json().get('items', {})

    # We only care about the Python releases, which all are in the format
    # "featured/google_appengine_{version}.zip". We'll extract the version
    # number so we can sort the list by version, and finally get the download
    # URL.
    versions_and_urls = []
    for release in releases:
        match = PYTHON_RELEASE_RE.match(release['name'])

        if not match:
            continue

        versions_and_urls.append(
            ([int(x) for x in match.groups()], release['mediaLink']))

    return sorted(versions_and_urls, key=lambda x: x[0])
280624
private static int getAppVersion(Context context) {
        try {
            PackageInfo packageInfo = context.getPackageManager()
                    .getPackageInfo(context.getPackageName(), 0);
            return packageInfo.versionCode;
        } catch (NameNotFoundException e) {
            // should never happen
            throw new RuntimeException("Coult not get package name: " + e);
        }
    }
1272804
public com.google.appengine.v1.Version getVersions(int index) {
    return versions_.get(index);
  }
102633
def get_released_versions(component):
    

    releases = get_tags()
    releases = sorted([(x[0], [int(y) for y in x[1].split('.')]) for x in releases], key=lambda x: x[1])[::-1]

    return [(x[0], ".".join(map(str, x[1]))) for x in releases if x[0] == component]
1164843
def list(latest = false)
      result = []
      @os.map do |os, versions|
        unless latest
          versions.each { |version| result << {os: os, version: version}}
        else
          result << {os: os, version: versions.last} if versions.length > 0
        end
      end
      result
    end
314910
def list_pkgs(versions_as_list=False, **kwargs):
    '''
    
    '''
    versions_as_list = salt.utils.data.is_true(versions_as_list)
    # not yet implemented or not applicable
    if any([salt.utils.data.is_true(kwargs.get(x))
            for x in ('removed', 'purge_desired')]):
        return {}

    if 'pkg.list_pkgs' in __context__:
        if versions_as_list:
            return __context__['pkg.list_pkgs']
        else:
            ret = copy.deepcopy(__context__['pkg.list_pkgs'])
            __salt__['pkg_resource.stringify'](ret)
            return ret

    ret = {}
    cmd = 'pkg_info -q -a'
    out = __salt__['cmd.run_stdout'](cmd, output_loglevel='trace')
    for line in out.splitlines():
        try:
            pkgname, pkgver, flavor = __PKG_RE.match(line).groups()
        except AttributeError:
            continue
        pkgname += '--{0}'.format(flavor) if flavor else ''
        __salt__['pkg_resource.add_pkg'](ret, pkgname, pkgver)

    __salt__['pkg_resource.sort_pkglist'](ret)
    __context__['pkg.list_pkgs'] = copy.deepcopy(ret)
    if not versions_as_list:
        __salt__['pkg_resource.stringify'](ret)
    return ret
452120
def versions(runas=None):
    '''
    
    '''
    ret = _rbenv_exec(['versions', '--bare'], runas=runas)
    return [] if ret is False else ret.splitlines()