def forget(modname):
unload(modname)<EOL>for dirname in sys.path:<EOL><INDENT>source = os.path.join(dirname, modname + '<STR_LIT>')<EOL>unlink(source + '<STR_LIT:c>')<EOL>unlink(source + '<STR_LIT:o>')<EOL>unlink(imp.cache_from_source(source, debug_override=True))<EOL>unlink(imp.cache_from_source(source, debug_override=False))<EOL><DEDENT>
Forget' a module was ever imported.

    This removes the module from sys.modules and deletes any PEP 3147 or
    legacy .pyc and .pyo files.