Returns list of available os versions filtered by conditions

 Each condition is treated as OR operation
 If no condition is specified all items are listed
 If TrueClass is supplied as one of the arguments it filters only last versions
420039
def filter(*conditions)
      latest = !conditions.select {|item| item === true }.empty?
      filters = translate_conditions(conditions)
      items = list(latest)
      unless filters.empty?
        items = items.select do |item|
          !filters.select {|filter| match_filter(filter, item) }.empty?
        end

      end
      items
    end
521314
def get_version():
    
    reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]')
    with open('requests_kerberos/__init__.py') as fd:
        matches = list(filter(lambda x: x, map(reg.match, fd)))

    if not matches:
        raise RuntimeError(
            'Could not find the version information for requests_kerberos'
            )

    return matches[0].group(1)
530956
def missing_versions_before(last_rollback)
      return [] unless last_rollback

      rollback_index = applied_versions.index(last_rollback)

      stop = if rollback_index == applied_versions.length - 1
        # rolled back to oldest version, a rollback
        # would put us in a versionless state.
        # Any versions up to target should be applied
        Version.new('0')
      else
        applied_versions[rollback_index + 1]
      end

      return [] if stop == target_version

      local_versions.select{ |v| v > stop && v <= target_version }
    end
167547
def versions_information(include_salt_cloud=False):
    '''
    
    '''
    salt_info = list(salt_information())
    lib_info = list(dependency_information(include_salt_cloud))
    sys_info = list(system_information())

    return {'Salt Version': dict(salt_info),
            'Dependency Versions': dict(lib_info),
            'System Versions': dict(sys_info)}
583261
def _check_ver(pyver, op, wanted):
    '''
    
    '''
    pyver = distutils.version.LooseVersion(pyver)
    wanted = distutils.version.LooseVersion(wanted)
    return getattr(operator, '__{}__'.format(op))(pyver, wanted)
313895
def _parse_version_string(version_conditions_string):
    '''
    
    '''
    result = []
    version_conditions_string = version_conditions_string.strip()
    if not version_conditions_string:
        return result
    for version_condition in version_conditions_string.split(','):
        operator_and_version = _get_comparison_spec(version_condition)
        result.append(operator_and_version)
    return result
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
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
949754
def existing_versions(self):
        
        import glob
        pattern = self.fname + '_*' + self.ext
        for fname in glob.glob1(self.dpath, pattern):
            fpath = join(self.dpath, fname)
            yield fpath
362897
def versions_from_archive(self):
        
        py_vers = versions_from_trove(self.classifiers)
        return [ver for ver in py_vers if ver != self.unsupported_version]
1323634
def _list_available_rest_versions(self):
        """"""
        url = "https://{0}/api/api_version".format(self._target)

        data = self._request("GET", url, reestablish_session=False)
        return data["version"]
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]
1338076
def _get_os_properties():
    
    if IS_DISTRO_INSTALLED:
        return distro.linux_distribution(full_distribution_name=False)
    return platform.linux_distribution(full_distribution_name=False)
115571
def asset_versions(self):
        
        if self._asset_versions is None:
            self._asset_versions = AssetVersionList(
                self._version,
                service_sid=self._solution['service_sid'],
                asset_sid=self._solution['sid'],
            )
        return self._asset_versions
90298
def list_conditions(self, service_id, version_number):
		""""""
		content = self._fetch("/service/%s/version/%d/condition" % (service_id, version_number))
		return map(lambda x: FastlyCondition(self, x), content)
219447
def version(*names, **kwargs):
    '''
    
    '''
    ret = {}
    versions_as_list = \
        salt.utils.data.is_true(kwargs.pop('versions_as_list', False))
    pkg_glob = False
    if names:
        pkgs = __salt__['pkg.list_pkgs'](versions_as_list=True, **kwargs)
        for name in names:
            if '*' in name:
                pkg_glob = True
                for match in fnmatch.filter(pkgs, name):
                    ret[match] = pkgs.get(match, [])
            else:
                ret[name] = pkgs.get(name, [])
    if not versions_as_list:
        __salt__['pkg_resource.stringify'](ret)
    # Return a string if no globbing is used, and there is one item in the
    # return dict
    if len(ret) == 1 and not pkg_glob:
        try:
            return next(six.itervalues(ret))
        except StopIteration:
            return ''
    return ret
393526
public static version_recommendations[] get_filtered(nitro_service service, String filter) throws Exception
	{
		version_recommendations obj = new version_recommendations();
		options option = new options();
		option.set_filter(filter);
		version_recommendations[] response = (version_recommendations[]) obj.getfiltered(service, option);
		return response;
	}