Returns the name and version of the current shell
551833
def info(self):
        """"""
        proc = Popen(['fish', '--version'],
                     stdout=PIPE, stderr=DEVNULL)
        version = proc.stdout.read().decode('utf-8').split()[-1]
        return u'Fish Shell {}'.format(version)
1258195
function getVersion() {
    // parse the version number
    try {
      // find the executable
      var resolvedPath = which.sync(whichExec)

      // grab the raw output
      var result = shell.exec(`"${resolvedPath}" ${versionCommand}`, { silent: true })
      var rawOut = ramda.trim(result.stdout || '')
      var rawErr = ramda.trim(result.stderr || '') // java -version does this... grr

      // assign the "right" one to raw
      var raw = rawOut
      if (ramda.isEmpty(raw)) {
        raw = rawErr
      }
      if (ramda.isEmpty(raw)) {
        raw = null
      }

      // and run it by the version matcher
      return versionMatcher(raw)
    } catch (err) {
      return null
    }
  }
538986
def version():
    """"""
    namespace = {}
    with open(os.path.join('mrcfile', 'version.py')) as f:
        exec(f.read(), namespace)
    return namespace['__version__']
952434
def current_version():
    
    # Monkeypatch setuptools.setup so we get the verison number
    import setuptools

    version = [None]

    def monkey_setup(**settings):
        version[0] = settings['version']

    old_setup = setuptools.setup
    setuptools.setup = monkey_setup

    import setup  # setup.py
    reload(setup)
    setuptools.setup = old_setup

    return version[0]
549945
def version(self):
        """"""
        stdout = Cmd.sh_e_out('{0} --version'.format(self.rpm_path))
        rpm_version = stdout.split()[2]
        return rpm_version
719305
def GetVersion():
  """"""

  with open(os.path.join('google', 'protobuf', '__init__.py')) as version_file:
    exec(version_file.read(), globals())
    return __version__
995449
def get_version():
    """"""
    _release = get_release()
    split_version = _release.split(".")
    if len(split_version) == 3:
        return ".".join(split_version[:2])
    return _release
217407
def current(self):
        

        config = self.alembic_config()
        script = ScriptDirectory.from_config(config)

        revision = 'base'

        def display_version(rev, context):
            for rev in script.get_all_current(rev):
                nonlocal revision
                revision = rev.cmd_format(False)

            return []

        with EnvironmentContext(config, script, fn=display_version):
            script.run_env()

        return revision
33101
def _get_version(prog, path):
        ''''''
        assert prog in prog_to_version_cmd
        args, regex = prog_to_version_cmd[prog]
        cmd = path + ' ' + args
        if prog == 'spades':
            cmd_output = subprocess.Popen(['python3', path, args], shell=False, stdout=subprocess.PIPE,
                                          stderr=subprocess.PIPE).communicate()
        else:
            cmd_output = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()

        cmd_output = common.decode(cmd_output[0]).split('\n')[:-1] + common.decode(cmd_output[1]).split('\n')[:-1]

        for line in cmd_output:
            hits = regex.search(line)
            if hits:
                return True, hits.group(1)

        return False, 'I tried to get the version of ' + prog + ' with: "' + cmd + '" and the output didn\'t match this regular expression: "' + regex.pattern + '"'
966176
def version(self):
        """"""
        if not self.__version:
            command = (self.name, '--version')
            logger.debug(command)
            stdout, _ = subprocess.Popen(
                command, stdout=subprocess.PIPE).communicate()
            version_output = str(stdout)
            match = re.search(self.version_patt, version_output)
            if match is None:
                raise ServersError(
                    'Could not determine version of %s from string: %s'
                    % (self.name, version_output))
            version_string = match.group('version')
            self.__version = tuple(map(int, version_string.split('.')))
        return self.__version
662079
def get_main_version(version):
    ""
    parts = 2 if version[2] == 0 else 3
    return '.'.join(str(x) for x in version[:parts])
996891
def get_version():
    """"""
    pkg_dir = get_package_dir()
    with open(os.path.join(pkg_dir, 'nestcheck/_version.py')) as ver_file:
        string = ver_file.read()
    return string.strip().replace('__version__ = ', '').replace('\'', '')
417756
def get_shell_folder (name):
    """"""
    try:
        import _winreg as winreg
    except ImportError:
        import winreg
    lm = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER)
    try:
        key = winreg.OpenKey(lm, r"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders")
        try:
            return winreg.QueryValueEx(key, name)[0]
        finally:
            key.Close()
    finally:
        lm.Close()
703148
def name_with_version(self):
        
        if self.version == 1:
            return self.name
        else:
            return '{}:{}'.format(self.name, self.version)
1101200
def version(self):
        

        resp = self.call('version')

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

        return resp
699308
def get_version(cls):
        
        cmd_pieces = [cls.tool, '--version']
        process = Popen(cmd_pieces, stdout=PIPE, stderr=PIPE)
        out, err = process.communicate()
        if err:
            return ''
        else:
            return out.splitlines()[0].strip()
573563
def stored_version(self, name):
        """"""
        link_path = self._link_path(name)
        if not _path_exists(link_path):
            return None
        return _file_version(link_path)