@classmethod
    def _refresh(cls):
        cls._rte_components.clear()

        # Assemble all paths to the RTE components.
        extension_paths = [
            component['dir'] for component in
            feconf.ALLOWED_RTE_EXTENSIONS.values()]

        # Crawl the directories and add new RTE component instances to the
        # registry.
        for loader, name, _ in pkgutil.iter_modules(path=extension_paths):
            module = loader.find_module(name).load_module(name)
            clazz = getattr(module, name)

            ancestor_names = [
                base_class.__name__ for base_class in clazz.__bases__]
            if 'BaseRichTextComponent' in ancestor_names:
                cls._rte_components[clazz.__name__] = clazz()
Crafts a navigator or from a hal-json link dict.
dataset/ETHPy150Open oppia/oppia/core/domain/rte_component_registry.py/Registry._refresh--crossover with--dataset/ETHPy150Open deontologician/restnavigator/restnavigator/halnav.py/HALNavigatorBase._navigator_or_thunk