Asks the current host what version of LXC it has.  Returns it as a
    string. If LXC is not installed, raises subprocess.CalledProcessError
354448
def get_lxc_version():
    

    runner = functools.partial(
        subprocess.check_output,
        stderr=subprocess.STDOUT,
        universal_newlines=True,
    )

    # Old LXC had an lxc-version executable, and prefixed its result with
    # "lxc version: "
    try:
        result = runner(['lxc-version']).rstrip()
        return parse_version(result.replace("lxc version: ", ""))
    except (OSError, subprocess.CalledProcessError):
        pass

    # New LXC instead has a --version option on most installed executables.
    return parse_version(runner(['lxc-start', '--version']).rstrip())
1173743
def version(hostname, timeout=20, username=None, password=None):
    '''
    
    '''
    return __version(__connect(hostname, timeout, username, password))
870814
def get_version(self):
        
        command = ["haproxy", "-v"]
        try:
            output = subprocess.check_output(command)
            version_line = output.split("\n")[0]
        except subprocess.CalledProcessError as e:
            logger.error("Could not get HAProxy version: %s", str(e))
            return None

        match = version_re.match(version_line)
        if not match:
            logger.error("Could not parse version from '%s'", version_line)
            return None

        version = (
            int(match.group("major")),
            int(match.group("minor")),
            int(match.group("patch"))
        )

        logger.debug("Got HAProxy version: %s", version)

        return version
24241
def getVersion(self):
        """"""
        if isinstance(self.version, versions.Version):  return self.version
        if self.version: # verify specified version exists
            version = versions.Version(self.version) # create this object to allow self._version_ to be specified in multiple different ways by the user
            if version.baseVersion not in self.installedApp.versionMap(): # verify that the selected version has an executable
                raise runConfigs.lib.SC2LaunchError(
                    "specified game version %s executable is not available.%s    available:  %s"%( \
                    version, os.linesep, "  ".join(self.installedApp.listVersions())))
            self.version = version
        else: # get most recent executable's version
            path = self.installedApp.exec_path()
            vResult = self.installedApp.mostRecentVersion
            self.version = versions.Version(vResult)
        if self.debug: print(os.linesep.join([
            "Game configuration detail:",
            "    platform:   %s"%(self.os),
            "    app:        %s"%(self.execPath),
            "    version:    %s"%(self.version)]))
        return self.version
83537
def juju_version():
    """"""
    # Per https://bugs.launchpad.net/juju-core/+bug/1455368/comments/1
    jujud = glob.glob('/var/lib/juju/tools/machine-*/jujud')[0]
    return subprocess.check_output([jujud, 'version'],
                                   universal_newlines=True).strip()
641369
def get_version(self):
        # type: () -> str
        
        # Get the version value
        version = getattr(self.__module, "__version__", None)
        if version:
            return version

        # Convert the __version_info__ entry
        info = getattr(self.__module, "__version_info__", None)
        if info:
            return ".".join(str(part) for part in __version_info__)

        # No version
        return "0.0.0"
681649
def get_tesseract_version():
    '''
    
    '''
    try:
        return LooseVersion(
            subprocess.check_output(
                [tesseract_cmd, '--version'], stderr=subprocess.STDOUT
            ).decode('utf-8').split()[1].lstrip(string.printable[10:])
        )
    except OSError:
        raise TesseractNotFoundError()
1153881
def version(self):
        
        cmd = b"version\r\n"
        results = self._misc_cmd([cmd], b'version', False)
        before, _, after = results[0].partition(b' ')

        if before != b'VERSION':
            raise MemcacheUnknownError(
                "Received unexpected response: %s" % results[0])
        return after
343645
def _connect_lxc(spec):
    
    return {
        'method': 'lxc',
        'kwargs': {
            'container': spec.remote_addr(),
            'python_path': spec.python_path(),
            'lxc_attach_path': spec.mitogen_lxc_attach_path(),
            'connect_timeout': spec.ansible_ssh_timeout() or spec.timeout(),
            'remote_name': get_remote_name(spec),
        }
    }
573791
def get_newest_possible_languagetool_version():
    
    java_path = find_executable('java')
    if not java_path:
        # Just ignore this and assume an old version of Java. It might not be
        # found because of a PATHEXT-related issue
        # (https://bugs.python.org/issue2200).
        return JAVA_6_COMPATIBLE_VERSION

    output = subprocess.check_output([java_path, '-version'],
                                     stderr=subprocess.STDOUT,
                                     universal_newlines=True)
    # https://www.oracle.com/technetwork/java/javase/versioning-naming-139433.html
    match = re.search(
        r'^java version "(?P<major1>\d+)\.(?P<major2>\d+)\.[^"]+"$',
        output,
        re.MULTILINE)
    if not match:
        raise SystemExit(
            'Could not parse Java version from """{}""".'.format(output))

    java_version = (int(match.group('major1')), int(match.group('major2')))
    if java_version >= (1, 7):
        return LATEST_VERSION
    elif java_version >= (1, 6):
        warn('grammar-check would be able to use a newer version of '
             'LanguageTool if you had Java 7 or newer installed')
        return JAVA_6_COMPATIBLE_VERSION
    else:
        raise SystemExit(
            'You need at least Java 6 to use grammar-check')
542581
def _get_version():
    '''
    
    '''
    version_string = __salt__['cmd.run'](
        [_check_pkgin(), '-v'],
        output_loglevel='trace')
    if version_string is None:
        # Dunno why it would, but...
        return False

    version_match = VERSION_MATCH.search(version_string)
    if not version_match:
        return False

    return version_match.group(1).split('.')
1252199
def pyVersionStr(self):
        
        from sys import version_info

        return "Python Interpreter Version: {}.{}.{}".format(version_info.major,
                                                             version_info.minor,
                                                             version_info.micro)
1017514
def checkconfig():
    '''
    
    '''
    cmd = ['lxc-checkconfig']
    return subprocess.check_output(cmd).replace('[1;32m', '').replace('[1;33m', '').replace('[0;39m', '').replace('[1;32m', '').replace(' ', '').split('\n')
775728
def _get_host_libc_from_host_compiler(self):
    """"""
    compiler_exe = self.get_options().host_compiler

    # Implicitly, we are passing in the environment of the executing pants process to
    # `get_compiler_library_dirs()`.
    # These directories are checked to exist!
    library_dirs = self._parse_search_dirs.get_compiler_library_dirs(compiler_exe)

    libc_crti_object_file = None
    for libc_dir_candidate in library_dirs:
      maybe_libc_crti = os.path.join(libc_dir_candidate, self._LIBC_INIT_OBJECT_FILE)
      if os.path.isfile(maybe_libc_crti):
        libc_crti_object_file = maybe_libc_crti
        break

    if not libc_crti_object_file:
      raise self.HostLibcDevResolutionError(
        "Could not locate {fname} in library search dirs {dirs} from compiler: {compiler!r}. "
        "You may need to install a libc dev package for the current system. "
        "For many operating systems, this package is named 'libc-dev' or 'libc6-dev'."
        .format(fname=self._LIBC_INIT_OBJECT_FILE, dirs=library_dirs, compiler=compiler_exe))

    return HostLibcDev(crti_object=libc_crti_object_file,
                       fingerprint=hash_file(libc_crti_object_file))
679147
def bll_version(self):
        
        if not self.started():
            return None
        status, data = self._rest.get_request('objects', 'system1',
                                              ['version', 'name'])
        return data['version']
426139
def get_mutect_version(mutect_jar):
    
    cl = ["java", "-Xms128m", "-Xmx256m"] + get_default_jvm_opts() + ["-jar", mutect_jar, "-h"]
    with closing(subprocess.Popen(cl, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout) as stdout:
        if "SomaticIndelDetector" in stdout.read().strip():
            mutect_type = "-appistry"
        else:
            mutect_type = ""
    version = os.path.basename(mutect_jar).lower()
    for to_remove in [".jar", "-standalone", "mutect"]:
        version = version.replace(to_remove, "")
    if version.startswith(("-", ".")):
        version = version[1:]
    if not version:
        raise ValueError("Unable to determine MuTect version from jar file. "
                         "Need to have version contained in jar (ie. muTect-1.1.5.jar): %s" % mutect_jar)
    _check_for_bad_version(version, "MuTect")
    return version + mutect_type
524302
def get_python_version(self) -> str:
        
        if self.python_version is None:
            python_version = platform.python_version()
        else:
            python_version = self.python_version

        return python_version