def load_submodules():
    """
    Load all submodules, adding all commands and event listeners to this
    module's global namespace.
    """
    for module_data in iter_modules(__path__, __name__ + '.'):
        loader, module_name, is_pkg = module_data

        if not is_pkg and module_name != __name__:
            # We look in sys.modules to avoid importing a module twice
            # (causing a reload)
            module = (
                sys.modules.get(module_name) or
                loader.find_module(module_name).load_module(module_name)
            )
            for class_name, class_def in inspect.getmembers(module):
                if inspect.isclass(class_def):
                    valid_command = (
                        is_child_class(class_def, ApplicationCommand) or
                        is_child_class(class_def, WindowCommand) or
                        is_child_class(class_def, TextCommand) or
                        is_child_class(class_def, EventListener)
                    )
                    if valid_command:
                        if class_name in __all__:
                            sublime.error_message(
                                collision_message.format(
                                    globals()[class_name], class_def
                                )
                            )
                        globals()[class_name] = class_def
                        __all__.append(class_name)
dataset/ETHPy150Open Varriount/NimLime/nimlime_core/commands/__init__.py/load_submodules/original