def _load_from_paths(self, paths, ignore_paths):
        self.logger.debug('Loading from paths.')
        for path in paths:
            self.logger.debug('Checking path %s', path)
            for root, _, files in os.walk(path, followlinks=True):
                should_skip = False
                for igpath in ignore_paths:
                    if root.startswith(igpath):
                        should_skip = True
                        break
                if should_skip:
                    continue
                for fname in files:
                    if os.path.splitext(fname)[1].lower() != '.py':
                        continue
                    filepath = os.path.join(root, fname)
                    try:
                        modname = os.path.splitext(filepath[1:])[0].translate(MODNAME_TRANS)
                        module = imp.load_source(modname, filepath)
                        self._load_module(module)
                    except (__HOLE__, ImportError), e:
                        if self.keep_going:
                            self.logger.warn('Failed to load {}'.format(filepath))
                            self.logger.warn('Got: {}'.format(e))
                        else:
                            raise LoaderError('Failed to load {}'.format(filepath), sys.exc_info())
                    except Exception as e:
                        message = 'Problem loading extensions from {}: {}'
                        raise LoaderError(message.format(filepath, e))
dataset/ETHPy150Open ARM-software/workload-automation/wlauto/core/extension_loader.py/ExtensionLoader._load_from_paths