def _save_and_block_module(name, orig_modules):
saved = True<EOL>try:<EOL><INDENT>orig_modules[name] = sys.modules[name]<EOL><DEDENT>except KeyError:<EOL><INDENT>saved = False<EOL><DEDENT>sys.modules[name] = None<EOL>return saved<EOL>
Helper function to save and block a module in sys.modules

       Return True if the module was in sys.modules, False otherwise.