Unpatch any previously patched modules.
    This operation is idempotent.
775339
def unpatch():
    
    _PATCHED_MODULES.discard('httplib')
    setattr(httplib, PATCH_FLAG, False)
    # _send_request encapsulates putrequest, putheader[s], and endheaders
    unwrap(httplib.HTTPConnection, '_send_request')
    unwrap(httplib.HTTPConnection, 'getresponse')
    unwrap(httplib.HTTPResponse, 'read')
1138188
def restore(self):
        
        try:
            for modname, mod in self._saved.items():
                if mod is not None:
                    sys.modules[modname] = mod
                else:
                    try:
                        del sys.modules[modname]
                    except KeyError:
                        pass
        finally:
            imp.release_lock()
1306094
def untrace_modules(self, modules):
        

        for module in modules:
            foundations.trace.untrace_module(module)
        self.__model__refresh_attributes()
        return True
193256
public void setPatches(java.util.Collection<Patch> patches) {
        if (patches == null) {
            this.patches = null;
            return;
        }

        this.patches = new com.amazonaws.internal.SdkInternalList<Patch>(patches);
    }
139704
def patched(attrs, updates):
    """"""
    orig = patch(attrs, updates.items())
    try:
        yield orig
    finally:
        patch(attrs, orig.items())
367627
def _patched_method(self, method, *args, **kwargs):
        
        self._validate()
        result = method(*args, **kwargs)
        self._validate()
        return result
51782
function() {
			global.requestSSLInitializing = false;
			global.requestSSLInitialized = true;
			global.requestSSLHooks = null;
			// unpatch ourselves
			request.Request.prototype.init = patchedInit;
			debug('init done');
			return patchedInit.apply(self,args);
		}
859125
def clean(file_, imports):
    """"""
    modules_not_imported = compare_modules(file_, imports)
    re_remove = re.compile("|".join(modules_not_imported))
    to_write = []

    try:
        f = open_func(file_, "r+")
    except OSError:
        logging.error("Failed on file: {}".format(file_))
        raise
    else:
        for i in f.readlines():
            if re_remove.match(i) is None:
                to_write.append(i)
        f.seek(0)
        f.truncate()

        for i in to_write:
            f.write(i)
    finally:
        f.close()

    logging.info("Successfully cleaned up requirements in " + file_)
179029
def _cleanup():
    '''
    
    '''
    for inst in _ACTIVE[:]:
        res = inst.isalive()
        if res is not True:
            try:
                _ACTIVE.remove(inst)
            except ValueError:
                # This can happen if two threads create a new Terminal instance
                # It's harmless that it was already removed, so ignore.
                pass
559817
private boolean removeUpdate() throws IOException, ServletException {
	final File patchDir = getPatchDirectory();
	final File[] patches = patchDir.listFiles(new ExtensionFilter(new String[] { "rc", "rcs" }));

	for (int i = 0; i < patches.length; i++)
	    if (!patches[i].delete()) patches[i].deleteOnExit();
	_restart();
	return true;
    }
1246458
def _cleanup_factory(self):
        """"""
        _self = weakref.proxy(self)
        def wrapper():
            try:
                _self.close(timeout=0)
            except (ReferenceError, AttributeError):
                pass
        return wrapper
853061
function unhook(vNode, patch, index) {
    if (isVNode(vNode)) {
        if (vNode.hooks) {
            patch[index] = appendPatch(
                patch[index],
                new VPatch(
                    VPatch.PROPS,
                    vNode,
                    undefinedKeys(vNode.hooks)
                )
            )
        }

        if (vNode.descendantHooks || vNode.hasThunks) {
            var children = vNode.children
            var len = children.length
            for (var i = 0; i < len; i++) {
                var child = children[i]
                index += 1

                unhook(child, patch, index)

                if (isVNode(child) && child.count) {
                    index += child.count
                }
            }
        }
    } else if (isThunk(vNode)) {
        thunks(vNode, null, patch, index)
    }
}
309338
synchronized private void clearCachedStructures() {
        mapsInitialized = false;
        packageMap = new HashMap();
        classSource = new HashMap();
        unqNameTable = null;
        nameSpaceChanged();
    }
260490
function (module) {

            var moduleObj;

            if (typeof module !== "string") {
                throw new Error("Missing or invalid argument");
            }

            if (!_initialized) {
                throw new Error("The Browser History Manager is not initialized");
            }

            moduleObj = _modules[module];
            if (!moduleObj) {
                throw new Error("No such registered module: " + module);
            }

            return unescape(moduleObj.currentState);
        }
618259
public void unloadModule(Module module) {
        Objects.requireNonNull(module, "module");
        unloadModuleLocal(module);
        moduleSpecs.remove(module.getIdentifier());
    }
120467
public function remove()
    {
        //if user selected not to update modules, skipping all updates
        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("noButton")) {
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("blSkipDeletedExtChecking", true);

            return;
        }

        $oModuleList = oxNew(\OxidEsales\Eshop\Core\Module\ModuleList::class);
        $oModuleList->cleanup();
    }
1234923
public void removeModules(List<String> modules) throws Exception {
        long startTime = System.currentTimeMillis();
        Exception exception = null;
        if (!cfg.exists()) {
            init();
        }
        userDir = new File(System.getProperty("user.dir")).getAbsolutePath();
        System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath());
        try {
            ConfigurationManager manager = new ConfigurationManager(cfg, false);

            ProjectConfigurationProvider cfgProvider = manager.getProjectConfigurationProvider();
            cfgProvider.removeModules(modules);
        } catch (Exception e) {
            exception = e;
        } finally {
            System.setProperty("user.dir", userDir);
            updateMsg(startTime, exception);
        }
    }