def METHOD_NAME(self):
    scan_result_table = {}
    for base in self.base_pkgs:
        package = importlib.import_module(base)
        for module_info in pkgutil.walk_packages(path=package.__path__, prefix=package.__name__ + "."):
            module_name = module_info.name
            if any(module_name.startswith(deprecated_package) for deprecated_package in DEPRECATED_PACKAGES):
                continue
            if module_name.startswith(base):
                if not self.exclude_libs or (".libs" not in module_name):
                    if any(module_name.startswith(base + "." + name + ".") for name in self.module_names):
                        try:
                            module = importlib.import_module(module_name)
                            for name, obj in inspect.getmembers(module):
                                if (
                                    not name.startswith("_")
                                    and inspect.isclass(obj)
                                    and obj.__module__ == module_name
                                ):
                                    # same class name exists in multiple modules
                                    if name in scan_result_table:
                                        scan_result = scan_result_table[name]
                                        if name in self._class_table:
                                            self._class_table.pop(name)
                                            self._class_table[f"{scan_result.module_name}.{name}"] = module_name
                                        self._class_table[f"{module_name}.{name}"] = module_name
                                    else:
                                        scan_result = _ModuleScanResult(class_name=name, module_name=module_name)
                                        scan_result_table[name] = scan_result
                                        self._class_table[name] = module_name
                        except (ModuleNotFoundError, RuntimeError) as e:
                            self._logger.debug(
                                f"Try to import module {module_name}, but failed: {secure_format_exception(e)}. "
                                f"Can't use name in config to refer to classes in module: {module_name}."
                            )
                            pass