return the version of 'pkg'
335110
def _get_pkgng_version(jail=None, chroot=None, root=None):
    '''
    
    '''
    cmd = _pkg(jail, chroot, root) + ['--version']
    return __salt__['cmd.run'](cmd).strip()
785277
def get_package_version():
    """"""
    base = os.path.abspath(os.path.dirname(__file__))
    with open(os.path.join(base, 'policy', '__init__.py'),
              mode='rt',
              encoding='utf-8') as initf:
        for line in initf:
            m = version.match(line.strip())
            if not m:
                continue
            return m.groups()[0]
627197
def get_version():
    
    if not INSTALLED:
        try:
            with open('version.txt', 'r') as v_fh:
                return v_fh.read()
        except Exception:
            warnings.warn(
                'Unable to resolve package version until installed',
                UserWarning
            )
            return '0.0.0'  #can't parse version without stuff installed

    return p_version.get_version(HERE)
1336006
def versions(mode=None, add_pckg=None, ncol=4):
    
    """
    # Issue warning
    mesg = ("\n    Func `versions` is deprecated and will " +
            "be removed; use Class `Versions` instead.")
    warnings.warn(mesg, DeprecationWarning)

    return Versions(add_pckg, ncol)
379352
def get_version():
    """"""
    config = RawConfigParser()
    config.read(os.path.join('..', 'setup.cfg'))
    return config.get('metadata', 'version')
1081698
function getUpdatedDeps (pkg, cb) {
  var opts = {
    stable: !argv.unstable,
    loose: true,
    error: {
      E404: argv.error404,
      ESCM: argv.errorSCM,
      EDEPTYPE: argv.errorDepType
    },
    ignore: argv.ignore || argv.i
  }

  if (argv.registry) {
    opts.npm = {registry: argv.registry}
  }

  david.getUpdatedDependencies(pkg, opts, function (err, deps) {
    if (err) return cb(err)

    david.getUpdatedDependencies(pkg, xtend(opts, {dev: true}), function (err, devDeps) {
      if (err) return cb(err)

      david.getUpdatedDependencies(pkg, xtend(opts, {optional: true}), function (err, optionalDeps) {
        cb(err, filterDeps(deps), filterDeps(devDeps), filterDeps(optionalDeps))
      })
    })
  })
}
845005
def get_version(module_name_or_file=None):
    """"""

    if module_name_or_file is None:
        parts = base_module.split('.')
        module_name_or_file = parts[0] if len(parts) > 1 else \
            find_packages(exclude=['test', 'test.*'])[0]

    if os.path.isdir(module_name_or_file):
        module_name_or_file = os.path.join(module_name_or_file, '__init__.py')

    with open(module_name_or_file, 'r') as f:
        match = VERSION_PATTERN.search(f.read())
        return match.group(1)
1321429
function getPackageVersion() {
  var packageJson = path.join(process.cwd(), 'package.json'),
    version;
  try {
    version = require(packageJson).version;
  } catch (unused) {
    throw new Error('Could not load package.json, please make sure it exists');
  }
  if (!semver.valid(version)) {
    throw new Error('Invalid version number found in package.json, please make sure it is valid');
  }

  return [ semver.major(version), semver.minor(version), semver.patch(version) ].join('.');
}
419039
function readPackageVersion(root) {
  let pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
  // use _originalVersion if present if we've already mutated it
  return pkg._originalVersion || pkg.version;
}
1213520
def query_versions_pypi(self, package_name):
        """"""
        if not package_name in self.pkg_list:
            self.logger.debug("Package %s not in cache, querying PyPI..." \
                    % package_name)
            self.fetch_pkg_list()
        #I have to set version=[] for edge cases like "Magic file extensions"
        #but I'm not sure why this happens. It's included with Python or
        #because it has a space in it's name?
        versions = []
        for pypi_pkg in self.pkg_list:
            if pypi_pkg.lower() == package_name.lower():
                if self.debug:
                    self.logger.debug("DEBUG: %s" % package_name)
                versions = self.package_releases(pypi_pkg)
                package_name = pypi_pkg
                break
        return (package_name, versions)
1200153
def get_version():
        """"""
        cmd = [PostgresFinder.find_root() / 'pg_ctl', '--version']
        results = subprocess.check_output(cmd).decode('utf-8')
        match = re.search(r'(\d+\.\d+(\.\d+)?)', results)
        if match:
            ver_string = match.group(0)
            return tuple(int(x) for x in ver_string.split('.'))
422097
def get_installed_version(self):
        """"""
        if self.check():
            return '%s (%s)' % (self.installed_version, self.OK)
        else:
            return '%s (%s)' % (self.installed_version, self.NOK)
719305
def GetVersion():
  """"""

  with open(os.path.join('google', 'protobuf', '__init__.py')) as version_file:
    exec(version_file.read(), globals())
    return __version__
1015047
def version(rest):
	""
	pkg = rest.strip() or 'pmxbot'
	if pkg.lower() == 'python':
		return sys.version.split()[0]
	return importlib_metadata.version(pkg)
404554
def get_version(package_name, version_file='_version.py'):
    """"""
    filename = os.path.join(os.path.dirname(__file__), package_name, version_file)
    with open(filename, 'rb') as fp:
        return fp.read().decode('utf8').split('=')[1].strip(" \n'")
894605
def versions_installed(pkg):
    '''
    
    '''

    try:
        # Try to run it, merging stderr into output
        output = subprocess.check_output([SNAP_BINARY_NAME, 'list', pkg], stderr=subprocess.STDOUT)
    except subprocess.CalledProcessError:
        return []

    lines = output.splitlines()[1:]
    ret = []
    for item in lines:
        # If fields contain spaces this will break.
        i = item.split()
        # Ignore 'Notes' field
        ret.append({
            'name':         i[0],
            'version':      i[1],
            'rev':          i[2],
            'tracking':     i[3],
            'publisher':    i[4]
            })

    return ret
979521
def get_version():
    """"""
    contents = read_file(os.path.join('admirarchy', '__init__.py'))
    version = re.search('VERSION = \(([^)]+)\)', contents)
    version = version.group(1).replace(', ', '.').strip()
    return version