Function to extract composer version number
352474
function () {
  var version = 'UnknownComposer';
  var versionString = shell.exec('composer --version', {silent: true}).output;
  // Example below:
  //    Composer version 1.0.0-alpha9 2014-12-07 17:15:20
  var versionRegex = /Composer version (\S+)/;
  var result = versionRegex.exec(versionString);
  if (result !== null) {
    version = result[1];
  } else {
    logger.logInfo('Could not find composer version from version string: ' + versionString);
  }
  return version;
}
66146
public function getFrameworkVersion()
    {
        $composerLockPath = BASE_PATH . '/composer.lock';
        if (!file_exists($composerLockPath)) {
            return 'unknown';
        }
        $lockData = json_decode(file_get_contents($composerLockPath), true);
        if (json_last_error() || empty($lockData['packages'])) {
            return 'unknown';
        }
        foreach ($lockData['packages'] as $package) {
            if ($package['name'] === 'silverstripe/framework') {
                return $package['version'];
            }
        }
        return 'unknown';
    }
334150
def get_version():
    """"""
    release = get_release()
    split_version = release.split(".")
    if len(split_version) == 3:
        return ".".join(split_version[:2])
    return release
128214
def get_version(package):
    """"""
    with io.open(os.path.join(BASE_DIR, package, '__init__.py'), encoding='utf-8') as fh:
        return [
            l.split('=', 1)[1].strip().strip("'").strip('"')
            for l in fh.readlines()
            if '__version__' in l][0]
652970
def get_version(version):
    ""
    assert len(version) == 5
    assert version[3] in ('alpha', 'beta', 'rc', 'final')
    parts = 2 if version[2] == 0 else 3
    main = '.'.join(map(str, version[:parts]))
    sub = ''
    if version[3] == 'alpha' and version[4] == 0:
        git_changeset = get_git_changeset()
        if git_changeset:
            sub = '.dev%s' % git_changeset
    elif version[3] != 'final':
        mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'}
        sub = mapping[version[3]] + str(version[4])
    return main + sub
1011681
function getVersion (plugin) {
  return new Promise(function (resolve, reject) {
    npm.commands.view([plugin, 'version'], function (err, data) {
      if (err) return reject(err)
      resolve(Object.keys(data)[0])
    })
  })
}
1312712
def getVersionNumber(self):
        """"""
        print '%s call getVersionNumber' % self.port
        versionStr = self.__sendCommand(WPANCTL_CMD + 'getprop -v NCP:Version')[0]

        return self.__stripValue(versionStr)
117599
function calculateVersion(officialRelease, callback) {
    var version = require('./package.json').version;

    if (officialRelease) {
        callback(version);
    } else {
        git.short(function (str) {
            callback(version + '+' + str);
        });
    }
}
1106006
def get_version(version):
    """"""
    if len(version) > 2 and version[2] is not None:
        if isinstance(version[2], int):
            str_version = "%s.%s.%s" % version[:3]
        else:
            str_version = "%s.%s_%s" % version[:3]
    else:
        str_version = "%s.%s" % version[:2]

    return str_version
1270750
def _extract_version(version_string, pattern):
    
    if version_string:
        match = pattern.match(version_string.strip())
        if match:
            return match.group(1)
    return ""
1170607
private function updateVersionNumber()
    {
        $dados = json_decode(file_get_contents(PATH_HOME . "_config/config.json"), true);
        $dados['version'] += 0.01;
        Config::createConfig($dados);

        Helper::createFolderIfNoExist(PATH_HOME . "_config/updates");
        $f = fopen(PATH_HOME . "_config/updates/version.txt", "w+");
        fwrite($f, file_get_contents(PATH_HOME . "composer.lock"));
        fclose($f);
    }
478970
def find_version():
    """"""
    version_file = read_file('__init__.py')
    version_match = re.search(r'^__version__ = ["\']([^"\']*)["\']',
                              version_file, re.M)
    if version_match:
        return version_match.group(1)
    raise RuntimeError('Unable to find version string.')
745328
public static function getDecomposerVersion($composerArray, $packages)
    {
        if (isset($composerArray['require'][self::PACKAGE_NAME])) {
            return $composerArray['require'][self::PACKAGE_NAME];
        }

        if (isset($composerArray['require-dev'][self::PACKAGE_NAME])) {
            return $composerArray['require-dev'][self::PACKAGE_NAME];
        }

        foreach ($packages as $package) {
            if (isset($package['dependencies'][self::PACKAGE_NAME])) {
                return $package['dependencies'][self::PACKAGE_NAME];
            }

            if (isset($package['dev-dependencies'][self::PACKAGE_NAME])) {
                return $package['dev-dependencies'][self::PACKAGE_NAME];
            }
        }

        return 'unknown';
    }
480818
def get_final_version_string(release_mode, semver, commit_count=0):
    """"""
    version_string = ".".join(semver)
    maybe_dev_version_string = version_string
    updates = {}
    if release_mode:
        # in production, we have something like `1.2.3`, as well as a flag e.g. PRODUCTION=True
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
    else:
        # in dev mode, we have a dev marker e.g. `1.2.3.dev678`
        maybe_dev_version_string = config.DEVMODE_TEMPLATE.format(
            version=version_string, count=commit_count
        )

    # make available all components of the semantic version including the full string
    updates[Constants.VERSION_FIELD] = maybe_dev_version_string
    updates[Constants.VERSION_STRICT_FIELD] = version_string
    return updates
191181
def extract_version():
    """"""
    with open('pdftools/__init__.py', 'r') as f:
        content = f.read()

    version_match = _version_re.search(content)
    version = str(ast.literal_eval(version_match.group(1)))
    return version
962071
def get_version():
    """"""
    VERSION_FILE = '../malcolm/version.py'
    mo = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]',
                   open(VERSION_FILE, 'rt').read(), re.M)
    if mo:
        return mo.group(1)
    else:
        raise RuntimeError(
            'Unable to find version string in {0}.'.format(VERSION_FILE))
1191393
public function getVersion()
    {
        $process = $this->getProcess();
        $processCommand = trim($this->findComposer() . ' --version');
        $process->setCommandLine($processCommand);
        $this->log->info('Running Composer command', ['command' => $processCommand]);
        $process->run();

        if ($process->isSuccessful() == false) {
            $composerError = remove_ansi($process->getErrorOutput());
            $this->log->error('Composer version process failure', ['composer' => $composerError]);
            throw new ComposerException('There was an error retrieving the Composer version');
        }

        return $process->getOutput();
    }