def _import_module(self, module, type='plugin'):
        # Sort of a hack... this helps with debugging, as uncaught exceptions
        # can show the wrong data (line numbers / relevant code) if linecache
        # doesn't get cleared when a module is reloaded. This is Python's
        # internal cache of code files and line numbers.
        linecache.clearcache()

        if inspect.ismodule(module):
            return reload(module)
        elif isinstance(module, basestring):
            return importlib.import_module('plugins.%s.%s' % (module, type))
Given a plugin name, will import it from its directory or reload it.
dataset/ETHPy150Open JohnMaguire/Cardinal/cardinal/plugins.py/PluginManager._import_module