def load_modules(self):
        self.main_modules_dirs = [module for module in os.listdir(self.modules_directory) if not module.startswith("__")]
        self.modules = []
        self.modules_with_errors = {}

        for root, dirs, files in os.walk(self.modules_directory):
            _, package, root = root.rpartition('routersploit')
            root = "".join((package, root)).replace(os.sep, '.')
            modules = map(lambda x: '.'.join((root, os.path.splitext(x)[0])), filter(lambda x: x.endswith('.py'), files))
            for module_path in modules:
                try:
                    module = importlib.import_module(module_path)
                except __HOLE__ as error:
                    self.modules_with_errors[module_path] = error
                else:
                    klasses = inspect.getmembers(module, inspect.isclass)
                    exploits = filter(lambda x: issubclass(x[1], Exploit), klasses)
                    # exploits = map(lambda x: '.'.join([module_path.split('.', 2).pop(), x[0]]), exploits)
                    # self.modules.extend(exploits)
                    if exploits:
                        self.modules.append(module_path.split('.', 2).pop())
dataset/ETHPy150Open reverse-shell/routersploit/routersploit/interpreter.py/RoutersploitInterpreter.load_modules