Gets the Qemu version.

        :param qemu_path: path to Qemu executable.
978704
def get_qemu_version(qemu_path):
        

        if sys.platform.startswith("win"):
            # Qemu on Windows doesn't return anything with parameter -version
            # look for a version number in version.txt file in the same directory instead
            version_file = os.path.join(os.path.dirname(qemu_path), "version.txt")
            if os.path.isfile(version_file):
                try:
                    with open(version_file, "rb") as file:
                        version = file.read().decode("utf-8").strip()
                        match = re.search("[0-9\.]+", version)
                        if match:
                            return version
                except (UnicodeDecodeError, OSError) as e:
                    log.warn("could not read {}: {}".format(version_file, e))
            return ""
        else:
            try:
                output = yield from subprocess_check_output(qemu_path, "-version")
                match = re.search("version\s+([0-9a-z\-\.]+)", output)
                if match:
                    version = match.group(1)
                    return version
                else:
                    raise QemuError("Could not determine the Qemu version for {}".format(qemu_path))
            except subprocess.SubprocessError as e:
                raise QemuError("Error while looking for the Qemu version: {}".format(e))
199285
def get_version(path="src/devpy/__init__.py"):
    
    init_content = open(path, "rt").read()
    pattern = r"^__version__ = ['\"]([^'\"]*)['\"]"
    return re.search(pattern, init_content, re.M).group(1)
155635
def get_version():
    """"""
    version = 'Not installed.'

    try:
        version = pkg_resources.get_distribution(__package__).version
    except pkg_resources.DistributionNotFound:
        pass

    return version
326360
def get_interpreter_path(version=None):
    """"""
    if version and version != str(sys.version_info[0]):
        return settings.PYTHON_INTERPRETER + version
    else:
        return sys.executable
86420
def get_version():
    
    try:
        version_file = open(os.path.join(ROOT_DIR, 'mollie', 'api', 'version.py'), encoding='utf=8')
    except TypeError:
        # support python 2
        version_file = open(os.path.join(ROOT_DIR, 'mollie', 'api', 'version.py'))
    contents = version_file.read()
    match = re.search(r'VERSION = [\'"]([^\'"]+)', contents)
    if match:
        return match.group(1)
    else:
        raise RuntimeError("Can't determine package version")
877885
private static String getVersionFromJar(final Path path) {
		Matcher matcher = JAR_VERSION.matcher(path.toString());
		if (matcher.matches()) {
			return matcher.group(1);
		} else {
			Logger.error("JAR file \"{}\" does not contain a version", path);
			return null;
		}
	}
174677
def GetVersion():
  
  with open(os.path.join('googleads', 'common.py')) as versions_file:
    source = versions_file.read()
  return re.search('\\nVERSION = \'(.*?)\'', source).group(1)
995537
def get_version():
    
    version_file = os.path.join(PKG, 'lib/version.py')
    ver_str_line = open(version_file, "rt").read()
    version_regex = r'^__version__ = [\'"]([^\'"]*)[\'"]'
    mo = re.search(version_regex, ver_str_line, re.M)
    if mo:
        return mo.group(1)
    else:
        raise RuntimeError('Unable to find version string in %s.'
                           % (version_file,))
774535
def get_pymata_version(self):
        
        task = asyncio.ensure_future(self.core.get_pymata_version())
        self.loop.run_until_complete(task)
958782
def namedb_read_version(path):
    
    con = sqlite3.connect( path, isolation_level=None, timeout=2**30 )
    con.row_factory = namedb_row_factory

    sql = 'SELECT version FROM db_version;'
    args = ()

    try:
        rowdata = namedb_query_execute(con, sql, args, abort=False)
        row = rowdata.fetchone()
        return row['version']
    except:
        # no version defined
        return '0.0.0.0'
    finally:
        con.close()
1007685
def get_version():
    
    version_file = os.path.join("paps_settings", "__init__.py")
    initfile_lines = open(version_file, 'rt').readlines()
    version_reg = r"^__version__ = ['\"]([^'\"]*)['\"]"
    for line in initfile_lines:
        mo = re.search(version_reg, line, re.M)
        if mo:
            return mo.group(1)
    raise RuntimeError(
        "Unable to find version string in {}".format(version_file)
    )
992314
def version():
    
    path = join("lib", _CONFIG["name"], "__version__.py")
    with open(path) as stream:
        exec(stream.read())
    return __version__
1283962
def get_version(path = Dir.pwd, options = {})
      rootdir = normalized_path(path)
      version = (options[:default]) ? options[:default] : FalkorLib.config[:versioning][:default]
      type    = (options[:type])    ? options[:type]    : FalkorLib.config[:versioning][:type]
      source  = (options[:source])  ? options[:source]  : FalkorLib.config[:versioning][:source][ type ]
      puts "type = '#{type}'"
      case type
      when 'file'
        versionfile = File.join( rootdir, source[:filename] )
        puts "versionfile = '#{versionfile}'"
        version = File.read( versionfile ).chomp if File.exist?( versionfile )
      when 'gem'
        getmethod = source[:getmethod ]
        version = eval( getmethod ) unless (getmethod.nil? || getmethod.empty?)
      when 'puppet_module'
        jsonfile = File.join( rootdir, source[:filename] )
        metadata = JSON.parse( IO.read( jsonfile ) )
        version  = metadata["version"]
      end
      version
    end
748713
def get_version(cls, path, memo={}):
        
        if path not in memo:
            memo[path] = subprocess.check_output(
                "git describe --tags --dirty 2> /dev/null",
                shell=True, cwd=path).strip().decode("utf-8")

            v = re.search("-[0-9]+-", memo[path])
            if v is not None:
                # Replace -n- with -branchname-n-
                branch = r"-{0}-\1-".format(cls.get_branch(path))
                (memo[path], _) = re.subn("-([0-9]+)-", branch, memo[path], 1)

        return memo[path]
1210907
def get_version():
    
    version_regex = re.compile(
        '__version__\\s*=\\s*(?P<q>[\'"])(?P<version>\\d+(\\.\\d+)*(-(alpha|beta|rc)(\\.\\d+)?)?)(?P=q)'
    )
    here = path.abspath(path.dirname(__file__))
    init_location = path.join(here, "CHAID/__init__.py")

    with open(init_location) as init_file:
        for line in init_file:
            match = version_regex.search(line)

    if not match:
        raise Exception(
            "Couldn't read version information from '{0}'".format(init_location)
        )

    return match.group('version')
1290970
def get_version():
    """"""
    try:
        # Try with the package manager, if present
        from pkg_resources import resource_string
        return resource_string(__name__, "VERSION.txt").decode('utf8').strip()
    except Exception:
        # If the package manager is not present, try reading the file
        version = os.path.join(os.path.dirname(__file__), "VERSION.txt")
        with open(version, "r") as f:
            return f.readlines()[0].strip()
1201678
def get_python_version()
      python_path = ::File.join(@name, 'bin', 'python')
      tmp = @runner.run_command("#{python_path} --version")
      if ( tmp.stderr =~ /^[Pp]ython (\d+\S+)/ )
        @python_version = $1
      elsif ( tmp.stdout =~ /^[Pp]ython (\d+\S+)/ )
        @python_version = $1
      else
        @python_version = ''
      end
    end