def _load(self, typ, version):
        """Return class for *typ* and *version*."""
        classes = self._get_type_dict()
        try:
            lst = classes[typ]
            dist = lst[0]
            groups = lst[1]
            klass = dist.load_entry_point(groups[0], typ)
            if version is not None and dist.version != version:
                return None
            return klass
        except __HOLE__:
            if self._search_path is None:
                return None
            # try to look in the whole environment
            for group in self._groups:
                for proj in self.env:
                    for dist in self.env[proj]:
                        if version is not None and version != dist.version:
                            continue
                        ep = dist.get_entry_info(group, typ)
                        if ep is not None:
                            dist.activate()
                            klass = ep.load(require=True, env=self.env)
                            self._have_new_types = True
                            return klass
                        if version is None:
                            # newest version didn't have entry point, so skip to next project
                            break
        return None
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/pkg_res_factory.py/PkgResourcesFactory._load