Return the version of the docker container running the present server,
    or '' if not in a container
548054
def get_container_version():
    """"""
    root_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
    version_file = os.path.join(root_dir, 'VERSION')
    if os.path.exists(version_file):
        with open(version_file) as f:
            return f.read()
    return ''
164881
def version(user=None, host=None, port=None, maintenance_db=None,
            password=None, runas=None):
    '''
    
    '''
    query = 'SELECT setting FROM pg_catalog.pg_settings ' \
            'WHERE name = \'server_version\''
    cmd = _psql_cmd('-c', query,
                    '-t',
                    host=host,
                    user=user,
                    port=port,
                    maintenance_db=maintenance_db,
                    password=password)
    ret = _run_psql(
        cmd, runas=runas, password=password, host=host, port=port, user=user)

    for line in salt.utils.itertools.split(ret['stdout'], '\n'):
        # Just return the first line
        return line
896442
def get_version(self):
        """"""
        _, version = misc.get_version(self.confdir)
        if version is None:
            return "Can't get the version."
        else:
            return "cslbot - %s" % version
1173743
def version(hostname, timeout=20, username=None, password=None):
    '''
    
    '''
    return __version(__connect(hostname, timeout, username, password))
153529
def redis_version(self):
        """"""
        if not hasattr(self, '_redis_version'):
            self._redis_version = tuple(
                map(int, self.connection.info().get('redis_version').split('.')[:3])
            )
        return self._redis_version
1294458
def version(self):
        '''
        
        '''
        output = self._run_vagrant_command(['--version'])
        m = re.search(r'^Vagrant (?P<version>.+)$', output)
        if m is None:
            raise Exception('Failed to parse vagrant --version output. output={!r}'.format(output))
        return m.group('version')
1101200
def version(self):
        

        resp = self.call('version')

        for key in ('rpc_version', 'store_version'):
            resp[key] = int(resp[key])

        return resp
891758
def api_version(self):
        
        request_url = "{}/api/0/version".format(self.instance)
        return_value = self._call_api(request_url)
        return return_value['version']
764812
def get_version():
    
    setup_versioneer()
    clean_cache()
    import versioneer
    version = versioneer.get_version()
    parsed_version = parse_version(version)
    if '*@' in str(parsed_version):
        import time
        version += str(int(time.time()))
    return version
383260
def getVersion(init_file):
    

    try:
        return os.environ['BUILDBOT_VERSION']
    except KeyError:
        pass

    try:
        cwd = os.path.dirname(os.path.abspath(init_file))
        fn = os.path.join(cwd, 'VERSION')
        with open(fn) as f:
            return f.read().strip()
    except IOError:
        pass

    version = getVersionFromArchiveId()
    if version is not None:
        return version

    try:
        p = Popen(['git', 'describe', '--tags', '--always'], stdout=PIPE, stderr=STDOUT, cwd=cwd)
        out = p.communicate()[0]

        if (not p.returncode) and out:
            v = gitDescribeToPep440(str(out))
            if v:
                return v
    except OSError:
        pass

    try:
        # if we really can't find the version, we use the date of modification of the most recent file
        # docker hub builds cannot use git describe
        return mTimeVersion(init_file)
    except Exception:
        # bummer. lets report something
        return "latest"
475243
def check_api_version(self):
        
        url = self.base_url + "/status/"
        juicer.utils.Log.log_debug("[REST:GET:%s]", url)

        _r = requests.get(url, auth=self.auth, headers=self.headers,
                          verify=False)

        if _r.status_code == Constants.PULP_GET_OK:  # server is up, cool.
            version = juicer.utils.load_json_str(_r.content)['api_version'].strip()
            if version != Constants.EXPECTED_SERVER_VERSION:  # we done goofed
                raise JuicerPulpError("Client expects %s and got %s -- you should probably update!" \
                                      % (Constants.EXPECTED_SERVER_VERSION, version))
        return True
996493
def _get_version():
    """"""
    with open("../waliki/__init__.py") as fh:
        for line in fh:
            if line.startswith("__version__ = "):
                return line.split("=")[-1].strip().strip("'").strip('"')
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__']
1309603
def version():
    """"""
    with open(os.path.join('curtsies', '__init__.py')) as input_file:
        for line in input_file:
            if line.startswith('__version__'):
                return ast.parse(line).body[0].value.s
377412
def get_version():
    
    VERSION_FILE = os.path.join(module_name, 'version.py')
    txt = open(VERSION_FILE).read()
    mo = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', txt, re.M)
    if mo:
        version = mo.group(1)
        bs_version = os.environ.get('MODULEVER', '0.0')
        assert bs_version == "0.0" or bs_version == version, \
            "Version {} specified by the build system doesn't match {} in " \
            "version.py".format(bs_version, version)
        return version
    else:
        raise RuntimeError('Unable to find version string in {0}.'
                           .format(VERSION_FILE))
498714
def get_version(path=VERSION_PATH):
    
    namespace = {}
    exec(read(path), namespace)
    return namespace['get_version'](short=True)
915333
def __get_dbms_version(self, make_connection=True):
        
        major, minor, _, _ = self.get_server_version(make_connection=make_connection)
        return '{}.{}'.format(major, minor)