def _save_and_remove_module(name, orig_modules):
<EOL>if name not in sys.modules:<EOL><INDENT>__import__(name)<EOL>del sys.modules[name]<EOL><DEDENT>for modname in list(sys.modules):<EOL><INDENT>if modname == name or modname.startswith(name + '<STR_LIT:.>'):<EOL><INDENT>orig_modules[modname] = sys.modules[modname]<EOL>del sys.modules[modname]<EOL><DEDENT><DEDENT>
Helper function to save and remove a module from sys.modules

       Raise ImportError if the module can't be imported.