def walk_modules(path, load=False):

    mods = []
    mod = __import__(path, {}, {}, [''])
    mods.append(mod)
    if hasattr(mod, '__path__'):
        for _, subpath, ispkg in iter_modules(mod.__path__):
            fullpath = path + '.' + subpath
            if ispkg:
                mods += walk_modules(fullpath)
            else:
                submod = __import__(fullpath, {}, {}, [''])
                mods.append(submod)
    return mods
Loads a module and all its submodules from a the given module path and
dataset/ETHPy150Open idumpling/robotx/robotx/utils/misc.py/walk_modules