def run_module(self, module, **kwargs):
        """
        Run Python module
        Raise exceptions if anything happen
        """
        lg.debug("Plugin %s: running module %s" % (self.name, module))
        try:
            plugin = __import__(module, globals(), locals(), ['Plugin'], -1)
        except __HOLE__ as e:
            lg.error("Plugin %s: can't load module %s: %s" % (self.name, module, e))
            raise

        try:
            plugin = plugin.Plugin(self, **kwargs)
        except Exception as e:
            lg.error("Plugin %s: can't initialize plugin module: %s" % (self.name, e))
            lg.exception(e)
            raise

        signal.signal(signal.SIGALRM, alarm_handler)
        if 'timeout' not in kwargs:
            kwargs['timeout'] = self.get_param('Timeout', default=120)

        try:
            signal.alarm(kwargs['timeout'])
            result = plugin.run()
        except PluginExecutionTimeout:
            result = Result()
            result.set_status('ERROR')
            result.add_error('Plugin execution exceeded timeout %d seconds' %
                             kwargs['timeout'])
        except Exception as e:
            lg.error("Plugin %s: module execution failed: %s" % (self.name, e))
            lg.exception(e)
            signal.alarm(0)
            raise

        signal.alarm(0)
        return result
dataset/ETHPy150Open gooddata/smoker/smoker/server/plugins/__init__.py/PluginWorker.run_module