Extracts the version
481418
def get_package_version(path):
    ''''''
    with open(VERSION_FILE, "rt") as f:
        verstrline = f.read()

    VERSION = r"^version = ['\"]([^'\"]*)['\"]"
    results = re.search(VERSION, verstrline, re.M)

    if results:
        version = results.group(1)
    else:
        raise RuntimeError("Unable to find version string in {}.".format(path))

    return version
702259
def get_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] != 'final':
        mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'}
        sub = mapping[VERSION[3]] + str(VERSION[4])

    return str(main + sub)
948217
def get_version():
    
    contents = read(os.path.join(PATH_BASE, 'srptools', '__init__.py'))
    version = re.search('VERSION = \(([^)]+)\)', contents)
    version = version.group(1).replace(', ', '.').strip()
    return version
951567
def unpack_version(version):
    """"""
    minor_version = version % VERSION_MULTIPLIER
    major_version = (version - minor_version) / VERSION_MULTIPLIER
    return (major_version, minor_version)
1157290
def get_version(file_name='beautysh/__init__.py'):
    """"""
    with open(file_name) as v_file:
        for line in v_file:
            if "__version__" in line:
                return eval(line.split('=')[-1])
1033955
def get_version(filename, version='1.00'):
    '''  '''
    with open(filename) as infile:
        for line in infile:
            if line.startswith('__version__'):
                try:
                    version = line.split("'")[1]
                except IndexError:
                    pass
                break
    return version
164399
def get_version():
    """"""
    try:
        tag = check_output(
            ["git", "describe", "--abbrev=0"], universal_newlines=True
        ).strip()
        assert not tag.startswith("v")
        version = tag

        # add .devNN if needed
        log = check_output(
            ["git", "log", "%s..HEAD" % tag, "--oneline"],
            universal_newlines=True,
        )
        commits_since_tag = log.count("\n")
        if commits_since_tag:
            version += ".dev%i" % commits_since_tag

        # update tcod/version.py
        open("tcod/version.py", "w").write('__version__ = "%s"\n' % version)
        return version
    except:
        exec(open("tcod/version.py").read(), globals())
        return __version__
395172
def get_version():
    """"""
    try:
        f = open('eztemplate/version.py', 'r')
    except IOError as e:
        if e.errno != errno.ENOENT:
            raise
        m = None
    else:
        m = re.match('^\s*__version__\s*=\s*(?P<version>.*)$', f.read(), re.M)
        f.close()

    __version__ = ast.literal_eval(m.group('version')) if m else None

    try:
        git_version = subprocess.check_output(['git', 'describe', '--dirty'])
    except:
        if __version__ is None:
            raise ValueError("cannot determine version number")
        return __version__

    m = re.match(r'^\s*'
                 r'(?P<version>\S+?)'
                 r'(-(?P<post>\d+)-(?P<commit>g[0-9a-f]+))?'
                 r'(-(?P<dirty>dirty))?'
                 r'\s*$', git_version.decode())
    if not m:
        raise ValueError("cannot parse git describe output")

    git_version = m.group('version')
    post = m.group('post')
    commit = m.group('commit')
    dirty = m.group('dirty')

    local = []

    if post:
        post = int(post)
        if post:
            git_version += '.post%d' % (post,)
            if commit:
                local.append(commit)

    if dirty:
        local.append(dirty)

    if local:
        git_version += '+' + '.'.join(local)

    if git_version != __version__:
        with open('eztemplate/version.py', 'w') as f:
            f.write("__version__ = %r\n" % (str(git_version),))

    return git_version
939606
def version(self):
        """"""

        versions = []
        versions.append("sosreport: %s" % __version__)

        for plugname, plug in self.loaded_plugins:
            versions.append("%s: %s" % (plugname, plug.version))

        self.archive.add_string(content="\n".join(versions),
                                dest='version.txt')
1185570
def _get_version(ctx, _, value):
    """"""

    if not value or ctx.resilient_parsing:
        return
    message = 'Zsl %(version)s\nPython %(python_version)s'
    click.echo(message % {
        'version': version,
        'python_version': sys.version,
    }, color=ctx.color)
    ctx.exit()
137118
def extract_version(filepath='jeni.py', name='__version__'):
    
    context = {}
    for line in open(filepath):
        if name in line:
            exec(line, context)
            break
    else:
        raise RuntimeError('{} not found in {}'.format(name, filepath))
    return context[name]
1139018
def get_version(filename, encoding='utf8'):
    

    with io.open(filename, encoding=encoding) as sourcecode:
        for line in sourcecode:
            version = RE_VERSION.match(line)
            if version:
                return version.group(1)

    return None
1056623
def get_version():
    
    version = '.'.join((str(each) for each in VERSION[:3]))
    if len(VERSION) > 3:
        version += VERSION[3]
    return version
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__']
1044886
def _get_version():
    """"""

    with open(join(dirname(__file__), '{{project.package}}/VERSION'), 'rb') as f:
        version = f.read().decode('ascii').strip()
    return version
1064141
def get_version(path):
    """"""

    with open(os.path.join(path, 'VERSION'), 'rb') as f:
        version = f.read().decode('ascii').strip()
    return version.strip()
268336
def get_version(filename):
    
    init_py = open(filename).read()
    return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)