Clears globals and reloads modules
438342
def clear_globals_reload_modules(self):
        """"""

        self.code_array.clear_globals()
        self.code_array.reload_modules()

        # Clear result cache
        self.code_array.result_cache.clear()
32863
function () {
            this.unloadCommonModules();
            var pageModRefpaths = this._modulesPaths.page;
            for (var pageId in pageModRefpaths) {
                if (pageModRefpaths.hasOwnProperty(pageId)) {
                    this.unloadPageModules(pageId);
                }
            }
        }
585585
function runModule(module, str, replacements) {
    var pattern = module.pattern,
        replace = module.replace,
        match;

    // Reset the pattern so we can re-use it
    pattern.lastIndex = 0;

    while ((match = pattern.exec(str)) !== null) {
        replacements[match.index] = {
            oldStr: match[0],
            newStr: typeof replace === "function"? replace(match) : replace
        };
        if (pattern.global === false) {
            // if the search isn't global we need to break manually
            // because pattern.exec() will always return something
            break;
        }
    }
}
520777
function reset() {
		globalConfig = {};
		modules = {};
		services = {};
		behaviors = {};
		instances = {};
		initialized = false;

		for (var i = 0; i < exports.length; i++) {
			delete application[exports[i]];
			delete Box.Context.prototype[exports[i]];
		}
		exports = [];
	}
657797
def _update_globals():
    

    if not sys.platform.startswith('java') and sys.platform != 'cli':
        return
    incompatible = 'extract_constant', 'get_module_constant'
    for name in incompatible:
        del globals()[name]
        __all__.remove(name)
637961
void closeAllScopeModules() {
        synchronized (puScopes) {
            for (String module : puScopes.keySet()) {
                close(module, false); //PK59717
            }
            puScopes.clear();
        }
    }
364544
def clear_modules():
        
        # next lets force remove any inasafe related modules
        modules = []
        for module in sys.modules:
            if 'inasafe' in module:
                # Check if it is really one of our modules i.e. exists in the
                # plugin directory
                tokens = module.split('.')
                path = ''
                for myToken in tokens:
                    path += os.path.sep + myToken
                parent = os.path.abspath(os.path.join(
                    __file__, os.path.pardir, os.path.pardir))
                full_path = os.path.join(parent, path + '.py')
                if os.path.exists(os.path.abspath(full_path)):
                    LOGGER.debug('Removing: %s' % module)
                    modules.append(module)
        for module in modules:
            del (sys.modules[module])
        for module in sys.modules:
            if 'inasafe' in module:
                print(module)

        # Lets also clean up all the path additions that were made
        package_path = os.path.abspath(os.path.join(
            os.path.dirname(__file__), os.path.pardir))
        LOGGER.debug('Path to remove: %s' % package_path)
        # We use a list comprehension to ensure duplicate entries are removed
        LOGGER.debug(sys.path)
        sys.path = [y for y in sys.path if package_path not in y]
        LOGGER.debug(sys.path)
740997
def clear_globals(self):
        """"""

        base_keys = ['cStringIO', 'IntType', 'KeyValueStore', 'undoable',
                     'is_generator_like', 'is_string_like', 'bz2', 'base64',
                     '__package__', 're', 'config', '__doc__', 'SliceType',
                     'CellAttributes', 'product', 'ast', '__builtins__',
                     '__file__', 'charts', 'sys', 'is_slice_like', '__name__',
                     'copy', 'imap', 'wx', 'ifilter', 'Selection', 'DictGrid',
                     'numpy', 'CodeArray', 'DataArray', 'datetime',
                     'vlcpanel_factory']

        for key in globals().keys():
            if key not in base_keys:
                globals().pop(key)
501216
def reload!
      clear

      @mixins.each do |file|
        mixin(file)
      end

      @callbacks.each do |callback|
        callback.call(self)
      end
    end
1063204
def reload_modules(self):
        """"""

        import src.lib.charts as charts
        from src.gui.grid_panels import vlcpanel_factory
        modules = [charts, bz2, base64, re, ast, sys, wx, numpy, datetime]

        for module in modules:
            reload(module)
352428
def cmd_reload_global(self, plname):
        
        gpmon = self.fv.gpmon
        p_info = gpmon.get_plugin_info(plname)
        gpmon.stop_plugin(p_info)
        self.fv.update_pending(0.5)
        self.fv.mm.load_module(plname)
        gpmon.reload_plugin(plname)
        self.fv.start_global_plugin(plname)
        return True
526810
def clear_modules(self):
        """"""
        for child in self.module_selection.winfo_children():
            child.destroy()

        self.clear_ui()

        tk.Label(self.module_ui, text="Start Modis and select a module").grid(
            column=0, row=0, padx=0, pady=0, sticky="W E N S")

        if self.current_button is not None:
            self.current_button.config(bg="white")

        self.module_buttons = {}
        self.current_button = None
1219991
def GLOBAL(self, node):
        """"""
        if isinstance(self.scope, FunctionScope):
            self.scope.globals.update(node.names)
1002357
protected function restoreGlobals() {
		foreach($this->globalsBackup as $key => $value) {
			$GLOBALS[$key] = $value;
		}
		foreach(array_diff(array_keys($GLOBALS), array_keys($this->globalsBackup)) as $newKey) {
			if($newKey != 'GLOBALS') {
				unset($GLOBALS[$newKey]);
			}
		}
	}
1261225
def reload(file = nil)
      clear_all
      if file
        read file
        return true
      end
      read_global
      read_user
      return true
    end
216307
function() {
        $module
          .data(metadata.promise, false)
          .data(metadata.xhr, false)
        ;
        $context
          .removeClass(className.error)
          .removeClass(className.loading)
        ;
      }
686565
def unload_module(self, module_name):
        """"""
        module = self.loaded_modules.get(module_name)
        if not module:
            _log.warning("Ignoring request to unload non-existant module '%s'",
                         module_name)
            return False

        module.stop(reloading=False)
        del self.loaded_modules[module_name]
        self.module_ordering.remove(module_name)
        return True