get class by name

def get_plugin_class(self, typ):
        """
        get class by name
        """
        if typ in self._class:
            return self._class[typ]

        # try to import by same name
        try:
            importlib.import_module("%s.%s" % (self.namespace, typ))
            if typ in self._class:
                return self._class[typ]

        except ImportError as e:
            self.log.debug("ImportError " + str(e))

        raise ValueError("unknown plugin '%s'" % typ)