'Return a view into the stdlibs zone for a particular language
and version\'s stdlib.
"lang" is the language, e.g. "Perl", for which to get a
stdlib.
"ver_str" (optional) is a specific version of the language,
e.g. "5.8".
On first get of a stdlib for a particular language, all
available stdlibs for that lang are updated, if necessary.
Returns None if there is not stdlib for this language.'

def get_lib(self, lang, ver_str=None):

    vers_and_names = self.vers_and_names_from_lang(lang)
    if (not vers_and_names):
        return None
    if (ver_str is None):
        ver = vers_and_names[(-1)][0]
    else:
        ver = _ver_from_ver_str(ver_str)
    key = (ver, 'zzz')
    idx = max(0, (bisect.bisect_right(vers_and_names, key) - 1))
    log.debug('best    stdlib    fit    for    %s    ver=%s    in    %s    is    %s', lang, ver, vers_and_names, vers_and_names[idx])
    stdlib_match = vers_and_names[idx]
    (stdlib_ver, stdlib_name) = stdlib_match
    if (stdlib_match not in self._stdlib_from_stdlib_ver_and_name):
        self._update_lang_with_ver(lang, ver=stdlib_ver)
        stdlib = StdLib(self.db, join(self.base_dir, stdlib_name), lang, stdlib_name)
        self._stdlib_from_stdlib_ver_and_name[stdlib_match] = stdlib
    return self._stdlib_from_stdlib_ver_and_name[stdlib_match]
