deletes the data that lets our program know if it is
        running as singleton when calling check_if_open,
        i.e check_if_open will return fals after calling this
961292
def release_singleton(self):
        '''
       '''
        with suppress(KeyError):
            del self.cfg['is_programming_running_info']
        with suppress(FileNotFoundError, AttributeError):
            os.remove(self.check_file)
617168
public static void clear() {
		for (int i = 0; i < index; ++i) {
			instances.get(i).clear();
		}
		index = 0;
	}
677070
def cleanup_lib(self):
        
        if not self.using_openmp:
            #this if statement is necessary because shared libraries that use
            #OpenMP will core dump when unloaded, this is a well-known issue with OpenMP
            logging.debug('unloading shared library')
            _ctypes.dlclose(self.lib._handle)
1195459
def delete(self, for_update=False):
        
        hash_key = self.get_hash_id()
        try:
            original_instance = self.load(hash_key, convert_key=False)
        except KeyError:
            return

        # Remove from the `all` index.
        all_index = self._query.all_index()
        all_index.remove(hash_key)

        # Remove from the secondary indexes.
        for field in self._indexes:
            for index in field.get_indexes():
                index.remove(original_instance)

        if not for_update:
            for field in self._fields.values():
                if isinstance(field, _ContainerField):
                    field._delete(self)

        # Remove the object itself.
        self.__database__.delete(hash_key)
496445
public static function clearDeletedInstances() {
		if( !isset(static::$instances[static::getClass()]) ) {
			return;
		}
		$instances = &static::$instances[static::getClass()];
		foreach( $instances as $id => $obj ) {
			/* @var static $obj */
			if( $obj->isDeleted() ) {
				unset($instances[$id]);
			}
		}
	}
493509
def clear_data(self):
        
        command = const.CMD_CLEAR_DATA
        command_string = ''
        cmd_response = self.__send_command(command, command_string)
        if cmd_response.get('status'):
            self.is_connect = False
            self.next_uid = 1
            return True
        else:
            raise ZKErrorResponse("can't clear data")
336746
def close(self):
        

        data = self.data
        self.data = None

        if hasattr(data, "close"):
            data.close()
1288444
def clean_history(self, widget, event=None):
        
        self.history_tree_store.clear()
        selected_sm_m = self.model.get_selected_state_machine_model()
        if selected_sm_m:
            # the core may continue running without the GUI and for this it needs its execution histories
            if state_machine_execution_engine.finished_or_stopped():
                selected_sm_m.state_machine.destroy_execution_histories()
                self.update()
49494
function () {
      var fileContent = self._readFileSync();

      if (fileContent.instances && fileContent.instances[this._id]) {
        delete fileContent.instances[this._id];

        self._writeFileSync(fileContent);
      }
      else {
        debug('deleteSync instance %s not exists for app: %s', this._id, self._app);
      }
    }
15219
public function sasDeleteInstance()
	{
		$clazz = $this->getCurrentClass();
		$instance = $this->getCurrentInstance();

		$this->setData('label', $instance->getLabel());

		$this->setData('uri', tao_helpers_Uri::encode($instance->getUri()));
		$this->setData('classUri', tao_helpers_Uri::encode($clazz->getUri()));
		$this->setView('sas/delete.tpl', 'tao');
	}
471654
def _reset(cls):
        """"""
        if os.getpid() != cls._cls_pid:
            cls._cls_pid = os.getpid()
            cls._cls_instances_by_target.clear()
            cls._cls_thread_by_target.clear()
319259
def drop(self):
        
        import os

        if self.path:
            if os.path.exists(self.path):
                os.remove(self.path)
        else:
            # Clear the in-memory data if there is no file path
            self._data = {}
496345
public static synchronized void removeInstance() {
        if (instance != null) {
            instance.removeShutdownHook();
            instance.restoreOriginalSystemOutAndErr();
            if (instance.getReader() != null) {
                instance.getReader().shutdown();
            }
            instance = null;
        }
    }
481101
def close(self):
        ""
        if self.is_open:
            logger.info('closing shelve data')
            try:
                self.shelve.close()
                self._shelve.clear()
            except Exception:
                self.is_open = False
732183
def singleton_init_by(init_fn=None):
    

    if not init_fn:
        def wrap_init(origin_init):
            return origin_init
    else:
        def wrap_init(origin_init):
            def __init__(self):
                origin_init(self)
                init_fn(self)

            return __init__

    def inner(cls_def: type):
        if not hasattr(cls_def, '__instancecheck__') or isinstance(cls_def.__instancecheck__,
                                                                   (types.BuiltinMethodType, _slot_wrapper)):
            def __instancecheck__(self, instance):
                return instance is self

            cls_def.__instancecheck__ = __instancecheck__

        _origin_init = cls_def.__init__
        cls_def.__init__ = wrap_init(_origin_init)

        return cls_def()

    return inner
145134
def rollback(self, verbose=False):
        
        for ns, insts in self.instances.items():
            insts.reverse()
            for inst in insts:
                try:
                    if verbose:
                        print(_format("Deleting instance {0}", inst.path))
                    self.conn.DeleteInstance(inst.path)
                except CIMError as ce:
                    print(_format("Error deleting instance {0}", inst.path))
                    print(_format("     {0} {1}",
                                  ce.status_code, ce.status_description))
        for ns, cnames in self.class_names.items():
            self.default_namespace = ns
            cnames.reverse()
            for cname in cnames:
                try:
                    if verbose:
                        print(_format("Deleting class {0!A}:{1!A}",
                                      ns, cname))
                    self.conn.DeleteClass(cname)
                except CIMError as ce:
                    print(_format("Error deleting class {0!A}:{1!A}",
                                  ns, cname))
                    print(_format("     {0} {1}",
                                  ce.status_code, ce.status_description))
141991
def clean_previous_run(self):
        
        # Execute the base class treatment...
        super(Satellite, self).clean_previous_run()

        # Clean my lists
        del self.broks[:]
        del self.events[:]