Determine the installed version of sklearn
762652
def read_sklearn_version():
        """"""
        from sklearn import __version__ as sklearn_ver
        sklearn_ver = str(sklearn_ver).split('.')
        sklearn_ver = [int(v) for v in sklearn_ver]
        major, minor = sklearn_ver[0], sklearn_ver[1]
        patch = sklearn_ver[2] if len(sklearn_ver) >= 3 else 0
        return major, minor, patch
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]
494077
def _check_pkg(target):
    '''
    
    '''
    ret = {}
    cmd = ['/usr/bin/lslpp', '-Lc', target]
    lines = __salt__['cmd.run'](
            cmd,
            python_shell=False).splitlines()

    name = ''
    version_num = ''
    rpmpkg = False
    for line in lines:
        if line.startswith('#'):
            continue

        comps = line.split(':')
        if len(comps) < 7:
            raise CommandExecutionError(
                'Error occurred finding fileset/package',
                info={'errors': comps[1].strip()})

        # handle first matching line
        if 'R' in comps[6]:
            name = comps[0]
            rpmpkg = True
        else:
            name = comps[1]     # use fileset rather than rpm package

        version_num = comps[2]
        break

    return name, version_num, rpmpkg
446619
def package_version():
    
    version = ""
    try:
        version = pkg_resources.get_distribution('instana').version
    except pkg_resources.DistributionNotFound:
        version = 'unknown'
    finally:
        return version
658678
def get_installed_version(vcs):
    
    version_path = _get_version_path(vcs)
    if not os.path.exists(version_path):
        raise VersionNotInstalledError
    with open(version_path, 'r') as f:
        return f.read().strip()
453864
def _guess_vc(self):
        
        if self.vc_ver <= 14.0:
            return

        default = r'VC\Tools\MSVC'
        guess_vc = os.path.join(self.VSInstallDir, default)
        # Subdir with VC exact version as name
        try:
            vc_exact_ver = os.listdir(guess_vc)[-1]
            return os.path.join(guess_vc, vc_exact_ver)
        except (OSError, IOError, IndexError):
            pass
304752
def check_version(self, check, timeout=None, metadata=None,
                      credentials=None):
        """"""
        return self.stub.CheckVersion(check, timeout=timeout,
                                      metadata=metadata,
                                      credentials=credentials)
1188457
def partition_version_classifiers(
        classifiers: t.Sequence[str], version_prefix: str = 'Programming Language :: Python :: ',
        only_suffix: str = ' :: Only') -> t.Tuple[t.List[str], t.List[str]]:
    """"""
    versions_min, versions_only = [], []
    for classifier in classifiers:
        version = classifier.replace(version_prefix, '')
        versions = versions_min
        if version.endswith(only_suffix):
            version = version.replace(only_suffix, '')
            versions = versions_only
        try:
            versions.append(tuple([int(_) for _ in version.split('.')]))
        except ValueError:
            pass
    return versions_min, versions_only
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
1168911
def svm_version_path(version):
        
        return os.path.join(Spark.HOME_DIR, Spark.SVM_DIR, 'v{}'.format(version))
772998
def get_installed_version(dist_name, working_set=None):
    """"""
    # Create a requirement that we'll look for inside of setuptools.
    req = pkg_resources.Requirement.parse(dist_name)

    if working_set is None:
        # We want to avoid having this cached, so we need to construct a new
        # working set each time.
        working_set = pkg_resources.WorkingSet()

    # Get the installed distribution from our working set
    dist = working_set.find(req)

    # Check to see if we got an installed distribution or not, if we did
    # we want to return it's version.
    return dist.version if dist else None
1309603
def version():
    """"""
    with open(os.path.join('curtsies', '__init__.py')) as input_file:
        for line in input_file:
            if line.startswith('__version__'):
                return ast.parse(line).body[0].value.s
1312334
def info():
    
    installation_path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))

    click.echo("colin {} {}".format(__version__, installation_path))
    click.echo("colin-cli {}\n".format(os.path.realpath(__file__)))

    # click.echo(get_version_of_the_python_package(module=conu))

    rpm_installed = is_rpm_installed()
    click.echo(get_version_msg_from_the_cmd(package_name="podman", use_rpm=rpm_installed))
    click.echo(get_version_msg_from_the_cmd(package_name="skopeo", use_rpm=rpm_installed))
    click.echo(get_version_msg_from_the_cmd(package_name="ostree",
                                            use_rpm=rpm_installed,
                                            max_lines_of_the_output=3))
1030206
def _get_corenlp_version():
    ""
    corenlp_home = os.environ.get("CORENLP_HOME")
    if corenlp_home:
        for fn in os.listdir(corenlp_home):
            m = re.match("stanford-corenlp-([\d.]+)-models.jar", fn)
            if m:
                return m.group(1)
680358
def _check_version():
    """"""
    from ._config import APP_NAME

    if VersionCache.load(APP_NAME).is_fresh:
        return

    from pkg_resources import parse_version
    from renku.version import __version__

    version = parse_version(__version__)
    allow_prereleases = version.is_prerelease

    latest_version = find_latest_version(
        'renku', allow_prereleases=allow_prereleases
    )

    if version < latest_version:
        click.secho(
            'You are using renku version {version}, however version '
            '{latest_version} is available.\n'
            'You should consider upgrading ...'.format(
                version=__version__,
                latest_version=latest_version,
            ),
            fg='yellow',
            bold=True,
        )

    VersionCache(pypi_version=str(latest_version)).dump(APP_NAME)
1360628
def _version_checker(module, minver):
    
    # We could use LooseVersion, but distutils imports imp which is deprecated
    version_regexp = r'[a-z]?((?:\d|\.)+\d+)(?:\.dev[0-9]+)?'
    version_tags = re.match(version_regexp, module.__version__)
    if not version_tags:
        return False
    version_tags = version_tags.group(1).split(".")
    version_tags = tuple(int(x) for x in version_tags)
    return version_tags >= minver
301053
def iter_installable_versions(self):
        
        for name in self._pyenv('install', '--list').out.splitlines():
            try:
                version = Version.parse(name.strip())
            except ValueError:
                continue
            yield version