def load_plugins(names=()):
    """Imports the modules for a sequence of plugin names. Each name
    must be the name of a Python module under the "beetsplug" namespace
    package in sys.path; the module indicated should contain the
    BeetsPlugin subclasses desired.
    """
    for name in names:
        bname = name.encode('utf8')
        modname = b'%s.%s' % (PLUGIN_NAMESPACE, bname)
        try:
            try:
                namespace = __import__(modname, None, None)
            except __HOLE__ as exc:
                # Again, this is hacky:
                if exc.args[0].endswith(' ' + name):
                    log.warn(u'** plugin {0} not found', name)
                else:
                    raise
            else:
                for obj in getattr(namespace, bname).__dict__.values():
                    if isinstance(obj, type) and issubclass(obj, BeetsPlugin) \
                            and obj != BeetsPlugin and obj not in _classes:
                        _classes.add(obj)

        except:
            log.warn(
                u'** error loading plugin {}:\n{}',
                name,
                traceback.format_exc(),
            )
dataset/ETHPy150Open beetbox/beets/beets/plugins.py/load_plugins