Remove instance from instance list
196938
def pop():
        """"""
        pid = os.getpid()
        thread = threading.current_thread()
        Wdb._instances.pop((pid, thread))
153930
public static Delete delete(final Instance... _instances)
    {
        return delete(Arrays.stream(_instances)
                        .map(instance -> instance.getOid())
                        .toArray(String[]::new));
    }
927762
function destroyInstance (instanceId) {
  var instance = instanceOptions[instanceId];
  if (instance && instance.app instanceof instance.Vue) {
    try {
      instance.app.$destroy();
      instance.document.destroy();
    } catch (e) {}
    delete instance.document;
    delete instance.app;
  }
  delete instanceOptions[instanceId];
}
474273
def auto_delete_files_on_instance_change(
        instance: Any,
        fieldnames: Iterable[str],
        model_class) -> None:
    

    if not instance.pk:
        return  # instance not yet saved in database
    # noinspection PyUnresolvedReferences
    try:
        # noinspection PyUnresolvedReferences
        old_instance = model_class.objects.get(pk=instance.pk)
    except model_class.DoesNotExist:
        return  # old version gone from database entirely
    for fieldname in fieldnames:
        old_filefield = getattr(old_instance, fieldname, None)
        if not old_filefield:
            continue
        new_filefield = getattr(instance, fieldname, None)
        if old_filefield != new_filefield:
            if os.path.isfile(old_filefield.path):
                os.remove(old_filefield.path)
549989
def delete_instance_if_removed(self, port):
        """"""
        instance_type = self.get_instance_type(port)
        if not instance_type:
            return
        if not db_lib.instance_provisioned(port['device_id']):
            i_res = MechResource(port['device_id'], instance_type,
                                 a_const.DELETE)
            self.provision_queue.put(i_res)
1088810
public void removeInstance( String applicationName, String instancePath ) {
		this.logger.finer( String.format( "Removing instance \"%s\" from application \"%s\"...",
				instancePath, applicationName ) );

		WebResource path = this.resource
				.path( UrlConstants.APP )
				.path( applicationName )
				.path( "instances" )
				.queryParam( "instance-path", instancePath );

		this.wsClient.createBuilder( path ).delete();
		this.logger.finer( String.format( "Instance \"%s\" has been removed from application \"%s\"",
				instancePath, applicationName ) );
	}
268464
@Override
    public <Instance> void removeInstance(Instance instance) {
        DatastoreType datastoreType = getDatastoreType(instance);
        DatastoreId id = getDatastoreId(datastoreType);
        cache.remove(id);
    }
22114
def terminate(instance_id=None, name=None, region=None,
              key=None, keyid=None, profile=None, filters=None):
    '''
    
    '''
    instances = find_instances(instance_id=instance_id, name=name,
                               region=region, key=key, keyid=keyid,
                               profile=profile, return_objs=True,
                               filters=filters)
    if instances in (False, None, []):
        return instances

    if len(instances) == 1:
        instances[0].terminate()
        return True
    else:
        log.warning('Refusing to terminate multiple instances at once')
        return False
778414
protected void releaseInstance(T instance) throws IOException {
    AtomicInteger currentCount = providedVsCount.get(instance);
    if(currentCount != null) {
      if(currentCount.decrementAndGet() < 0) {
        currentCount.incrementAndGet();
        throw new IllegalArgumentException("Given instance of " + instance.getClass().getName() + " is not managed by this provider");
      }
    } else {
      throw new IllegalArgumentException("Given instance of " + instance.getClass().getName() + " is not managed by this provider");
    }

    if(instantiated.remove(instance) && instance instanceof Closeable) {
      ((Closeable)instance).close();
    }
  }
1224247
def clear(self):
        
        vname = self.varname
        if self.path.exists():
            logger.debug('deleting cached work: {}'.format(self.path))
            self.path.unlink()
        if self.owner is not None and hasattr(self.owner, vname):
            logger.debug('removing instance var: {}'.format(vname))
            delattr(self.owner, vname)
        self.clear_global()
166609
def filter_instance(inst, plist):
    

    if plist is not None:
        for pname in inst.properties.keys():
            if pname.lower() not in plist:
                del inst.properties[pname]
11131
public static void deleteInstanceResources( Instance instance )	throws IOException {
		File dir = InstanceHelpers.findInstanceDirectoryOnAgent( instance );
		Utils.deleteFilesRecursively( dir );
	}
898155
def stop_instance(self, instance):
        
        params = {'state': 'stopped'}
        url = '/instances/{}'.format(instance)
        self.patch_proto(url, params=params)
1231718
public function remove($id, $instanceName)
    {
        $this->getConnection()->table($this->getTableName())
            ->where('id', $id)
            ->where('instance', $instanceName)
            ->delete();
    }
398825
def instances(cls):
        
        l = [i for i in cls.allinstances() if isinstance(i, cls)]
        return l
845282
def delete(self, instance, session):
        ''''''
        if instance._meta.type == 'structure':
            return self._delete_structure(instance)
        inst = self.pop(instance)
        instance = inst if inst is not None else instance
        if instance is not None:
            state = instance.get_state()
            if state.persistent:
                state.deleted = True
                self._deleted[state.iid] = instance
                instance.session = session
            else:
                instance.session = None
            return instance
1018720
def remove(cls, id):
        

        api = Client.instance().api
        api.index(id).delete()