def rlist_modules(mname):
module = import_module(mname)<EOL>if not module:<EOL><INDENT>raise ImportError('<STR_LIT>'.format(mname))<EOL><DEDENT>found = list()<EOL>if _should_use_module_path(module):<EOL><INDENT>mpath = module.__path__[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>mpaths = sys.path<EOL>mpath = _scan_paths_for(mname, mpaths)<EOL><DEDENT>if mpath:<EOL><INDENT>for pmname in _search_for_modules(mpath, recursive=True):<EOL><INDENT>found_mod = MODULE_PATH_SEP.join((mname, pmname))<EOL>found.append(found_mod)<EOL><DEDENT><DEDENT>return found<EOL>
Attempts to the submodules under a module recursively. This function
works for modules located in the default path as well as extended paths
via the sys.meta_path hooks.

This function carries the expectation that the hidden module variable
'__path__' has been set correctly.

:param mname: the module name to descend into