Return the appropriate codec for the version in InputStream
188826
private SnapshotCodec getCodec(InputStream in) {
    BinaryDecoder decoder = new BinaryDecoder(in);
    int persistedVersion;
    try {
      persistedVersion = decoder.readInt();
    } catch (IOException e) {
      LOG.error("Unable to read transaction state version: ", e);
      throw Throwables.propagate(e);
    }
    return getCodecForVersion(persistedVersion);
  }
282807
def get_version():
    
    here = os.path.abspath(os.path.dirname(__file__))
    jbxapi_file = os.path.join(here, "jbxapi.py")

    with open(jbxapi_file) as f:
        content = f.read()
        match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", content, re.M)

    if not match:
        raise RuntimeError("Unable to find version string.")
    return match.group(1)
331141
@Override
    public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream audioInputStream) {
        if (isConversionSupported(targetFormat, audioInputStream.getFormat())) {
            return new DecodedVorbisAudioInputStream(targetFormat, audioInputStream);
        } else {
            throw new IllegalArgumentException("conversion not supported");
        }
    }
223693
def version():
    """"""
    with open(os.path.join(os.path.abspath(os.path.dirname(__file__)),
                           'pep8radius',
                           'main.py')) as input_file:
        for line in input_file:
            if line.startswith('__version__'):
                return parse(line).body[0].value.s
202885
def _resolve_version(version):
    
    if version is not LATEST:
        return version

    resp = urlopen('https://pypi.python.org/pypi/setuptools/json')
    with contextlib.closing(resp):
        try:
            charset = resp.info().get_content_charset()
        except Exception:
            # Python 2 compat; assume UTF-8
            charset = 'UTF-8'
        reader = codecs.getreader(charset)
        doc = json.load(reader(resp))

    return str(doc['info']['version'])
746503
def _Decode(self, codec_name, data):
    """"""
    try:
      return data.decode(codec_name, "replace")
    except LookupError:
      raise RuntimeError("Codec could not be found.")
    except AssertionError:
      raise RuntimeError("Codec failed to decode")
817523
def get_version(self):
        

        result = self._client.get("version").content

        if isinstance(result, bytes):
            result = result.decode('utf-8')

        return result.strip('\n')
268336
def get_version(filename):
    
    init_py = open(filename).read()
    return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)
1310842
def version(which="num"):
    """"""
    if which in VERSIONS:
        return VERSIONS[which]
    else:
        raise CoconutException(
            "invalid version type " + ascii(which),
            extra="valid versions are " + ", ".join(VERSIONS),
        )
654420
public File getFilteredVersion(File input) {
        File out = getOutputFile(input);
        if (!out.isFile()) {
            return null;
        }
        return out;
    }
1090700
def get_version(filepath='src/birding/version.py'):
    """"""
    with open(get_abspath(filepath)) as version_file:
        return re.search(
            r"""__version__\s+=\s+(['"])(?P<version>.+?)\1""",
            version_file.read()).group('version')
595808
def get_gitpython_version():
    
    # if not in git clone, it doesn't matter
    if not in_git_clone():
        return 'GitPython'

    # otherwise, call out to get the git version
    try:
        gitv = subprocess.check_output('git --version', shell=True)
    except (OSError, IOError, subprocess.CalledProcessError):
        # no git installation, most likely
        git_version = '0.0.0'
    else:
        if isinstance(gitv, bytes):
            gitv = gitv.decode('utf-8')
        git_version = gitv.strip().split()[2]

    # if git>=2.15, we need GitPython>=2.1.8
    if LooseVersion(git_version) >= '2.15':
        return 'GitPython>=2.1.8'
    return 'GitPython'
304145
def get_version(package):
    
    init_py = codecs.open(os.path.join(package, '__init__.py'), encoding='utf-8').read()
    return re.search("^__version__ = ['\"]([^'\"]+)['\"]", init_py, re.MULTILINE).group(1)
1044508
def version():
    """"""
    OPENJPEG.opj_version.restype = ctypes.c_char_p
    library_version = OPENJPEG.opj_version()
    if sys.hexversion >= 0x03000000:
        return library_version.decode('utf-8')
    else:
        return library_version
339367
protected String getVersion() throws IOException {
        InputStream stream = null;
        try {
            Properties version = new Properties();
            stream = Cob2XsdMain.class.getResourceAsStream(VERSION_FILE_NAME);
            version.load(stream);
            return version.getProperty("version");
        } finally {
            if (stream != null) {
                stream.close();
            }
        }
    }
1114572
def get_version():
    """"""
    if isinstance(VERSION[-1], str):
        return '.'.join(map(str, VERSION[:-1])) + VERSION[-1]
    return '.'.join(map(str, VERSION))
658535
def _get_version():
    """"""
    with open(os.path.join(os.path.dirname(__file__), PACKAGE_NAME, 'VERSION'), 'rb') as f:
        version = f.read().decode('ascii').strip()
    return version