Loads the version info from version.properties.
977942
@SuppressWarnings("nls")
    private void load() {
        URL url = Version.class.getResource("version.properties");
        if (url == null) {
            this.versionString = "Unknown";
            this.versionDate = new Date().toString();
        } else {
            allProperties = new Properties();
            try(InputStream is = url.openStream()){
                allProperties.load(is);
                this.versionString = allProperties.getProperty("version", "Unknown");
                this.versionDate = allProperties.getProperty("date", new Date().toString());
                this.vcsDescribe = allProperties.getProperty("git.commit.id.describe", "Non-Git Build");
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }
131355
private void initVersion() {

        // initialize version information with static defaults
        m_versionNumber = DEFAULT_VERSION_NUMBER;
        m_versionId = DEFAULT_VERSION_ID;
        m_version = "OpenCms/" + m_versionNumber;
        m_buildInfo = Collections.emptyMap();
        // read the version-informations from properties
        Properties props = new Properties();
        try {
            props.load(this.getClass().getClassLoader().getResourceAsStream("org/opencms/main/version.properties"));
        } catch (Throwable t) {
            // no properties found - we just use the defaults
            return;
        }
        // initialize OpenCms version information from the property values
        m_versionNumber = props.getProperty("version.number", DEFAULT_VERSION_NUMBER);
        m_versionId = props.getProperty("version.id", DEFAULT_VERSION_ID);
        m_version = "OpenCms/" + m_versionNumber;
        m_buildInfo = new TreeMap<String, BuildInfoItem>();

        // iterate the properties and generate the build information from the entries
        for (String key : props.stringPropertyNames()) {
            if (!"version.number".equals(key) && !"version.id".equals(key) && !key.startsWith("nicename")) {
                String value = props.getProperty(key);
                String nicename = props.getProperty("nicename." + key, key);
                m_buildInfo.put(key, new BuildInfoItem(value, nicename, key));
            }
        }
        // make the map unmodifiable
        m_buildInfo = Collections.unmodifiableMap(m_buildInfo);
    }
482330
def read_version():
    ""
    version_file = local_file('source', 'added_value', 'version.py')
    local_vars = {}
    with open(version_file) as handle:
        exec(handle.read(), {}, local_vars)  # pylint: disable=exec-used
    return local_vars['__version__']
1114572
def get_version():
    """"""
    if isinstance(VERSION[-1], str):
        return '.'.join(map(str, VERSION[:-1])) + VERSION[-1]
    return '.'.join(map(str, VERSION))
922701
def load_version(filename='fuzzyhashlib/version.py'):
    """"""
    with open(filename) as source:
        text = source.read()
        match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", text)
        if not match:
            msg = "Unable to find version number in {}".format(filename)
            raise RuntimeError(msg)
        version = match.group(1)
        return version
71765
function loadCurrentVersion (options, context) {
  return new Extension(options, context).read()
    .then(function (response) {
      let version = response.sys.version;

      options.version = version;
      return options;
    });
}
182119
def get_version():
    """"""
    import imp
    import os
    mod = imp.load_source(
        'version', os.path.join('skdata', '__init__.py')
    )
    return mod.__version__
624146
def get_version():
    """"""

    path = os.path.join(os.path.dirname(__file__), 'backrefs')
    fp, pathname, desc = imp.find_module('__meta__', [path])
    try:
        vi = imp.load_module('__meta__', fp, pathname, desc).__version_info__
        return vi._get_canonical(), vi._get_dev_status()
    except Exception:
        print(traceback.format_exc())
    finally:
        fp.close()
398969
def handle_versions(repo, **kwargs):
    """"""
    log.info('versions: %s %s' %(repo, kwargs))
    if not hasattr(repo, 'versions'):
        return []
    return [v.serialize() for v in repo.versions(**kwargs)]
714919
def get_version(version=None):
    """"""
    if version is None:
        version = VERSION
    assert len(version) == 5
    assert version[3] in ('alpha', 'beta', 'rc', 'final')

    # Now build the two parts of the version number:
    # main = X.Y[.Z]
    # sub = .devN - for pre-alpha releases
    #     | {a|b|c}N - for alpha, beta and rc releases

    parts = 2 if version[2] == 0 else 3
    main = '.'.join(str(x) for x in version[:parts])

    sub = ''
    if version[3] == 'alpha' and version[4] == 0:
        # At the toplevel, this would cause an import loop.
        from django.utils.version import get_svn_revision
        svn_revision = get_svn_revision()[4:]
        if svn_revision != 'unknown':
            sub = '.dev%s' % svn_revision

    elif version[3] != 'final':
        mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'}
        sub = mapping[version[3]] + str(version[4])

    return main + sub
434038
def load_index(self, version_string):
        
        filename = self._filename_for_version(version_string)
        try:
            contents = self._fslayer.file_contents(filename)
        except FileReadError as e:
            raise IndexLoadError(str(e))
        return contents
598852
def get_version():
    """"""
    with io.open('grammar_check/__init__.py', encoding='utf-8') as input_file:
        for line in input_file:
            if line.startswith('__version__'):
                return ast.parse(line).body[0].value.s
269711
def Version():
  """"""

  version_ini = VersionPath()

  config = configparser.SafeConfigParser()
  config.read(version_ini)
  return dict(
      packageversion=config.get("Version", "packageversion"),
      major=config.getint("Version", "major"),
      minor=config.getint("Version", "minor"),
      revision=config.getint("Version", "revision"),
      release=config.getint("Version", "release"))
1276449
private void initVersion() {
        VersionValues ver = getServiceContext().getRequestVersion();
        VersionValues configVer = getServiceContext().getHttpConfig().getOutgoingVersion();
        if (VersionValues.V10.equals(configVer) && VersionValues.V11.equals(ver)) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Configuration forcing 1.0 instead of 1.1");
            }
            setVersion(configVer);
        } else {
            setVersion(ver);
        }
    }
1310486
def get_version():
    """"""
    import ast

    with open(os.path.join("cyvcf2", "__init__.py"), "r") as init_file:
      module = ast.parse(init_file.read())

    version = (ast.literal_eval(node.value) for node in ast.walk(module)
         if isinstance(node, ast.Assign)
         and node.targets[0].id == "__version__")
    try:
      return next(version)
    except StopIteration:
          raise ValueError("version could not be located")
646989
private static String loadVersion(ClassLoader classLoader) throws IOException {
    try {
      Enumeration<URL> resources = classLoader.getResources("META-INF/MANIFEST.MF");

      while (resources.hasMoreElements()) {
        final URL url = resources.nextElement();
        final Manifest manifest = new Manifest(url.openStream());
        final Attributes mainAttributes = manifest.getMainAttributes();
        final String value = mainAttributes.getValue(IMPL_VERSION);

        if (value != null) {
          return value;
        }
      }

    } catch (IOException e) {
      LOG.error("Failed to read manifest", e);
      throw new IOException("Failed to find manifest", e);
    }

    return null;
  }
944644
def get_version_data():
    """"""
    connect_str = str(settings.CFG["db"]["connect_string"])
    repo_url = path.template_path("../db/")
    return (connect_str, repo_url)