'Whether a package with the supplied name exists.'

def exists(self, pkg_name):

    if self._all_package_names:
        idx = bisect_left(self.all_package_names(), pkg_name)
        return ((idx < len(self._all_package_names)) and (self._all_package_names[idx] == pkg_name))
    filename = self.filename_for_package_name(pkg_name)
    return os.path.exists(filename)
