def import_module(module_name):
if import_path != sys.path:<EOL><INDENT>imp.find_module(module_name.split('<STR_LIT:.>')[<NUM_LIT:0>], import_path)<EOL><DEDENT>if module_name in sys.modules:<EOL><INDENT>return sys.modules[module_name]<EOL><DEDENT>else:<EOL><INDENT>__import__(module_name)<EOL>return sys.modules[module_name]<EOL><DEDENT>
Imports a module. A single point of truth for importing modules to
be documented by `pydoc`. In particular, it makes sure that the top
module in `module_name` can be imported by using only the paths in
`pydoc.import_path`.

If a module has already been imported, then its corresponding entry
in `sys.modules` is returned. This means that modules that have
changed on disk cannot be re-imported in the same process and have
its documentation updated.