Wrap the hvac delete call, using the right token for
        cubbyhole interactions.
779116
def delete(self, path):
        """"""
        path = sanitize_mount(path)
        val = None
        if path.startswith('cubbyhole'):
            self.token = self.initial_token
            val = super(Client, self).delete(path)
            self.token = self.operational_token
        else:
            super(Client, self).delete(path)

        return val
929814
def _notify_delete(self, index_or_slice):
        
        if isinstance(index_or_slice, int):
            length = len(self)
            if -length <= index_or_slice < length:
                self._notify_remove_at(index_or_slice)
                return lambda: self._notify_add_at(index_or_slice)
        elif isinstance(index_or_slice, slice):
            slice_ = slice(*index_or_slice.indices(len(self)))
            self._notify_remove(slice_)
            return lambda: self._notify_add(index_or_slice)
1366039
def _enable_cleanup(func):
    

    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        self = args[0]
        result = func(*args, **kwargs)
        self.cleanup(self)
        return result

    return wrapper
1346055
def create_deletion_handler(preference):
    
    def delete_related_preferences(sender, instance, *args, **kwargs):
        queryset = preference.registry.preference_model.objects\
                                      .filter(name=preference.name,
                                              section=preference.section)
        related_preferences = queryset.filter(
            raw_value=preference.serializer.serialize(instance))
        related_preferences.delete()
    return delete_related_preferences
1333806
def marvcli_cleanup(ctx, discarded, unused_tags):
    """"""
    if not any([discarded, unused_tags]):
        click.echo(ctx.get_help())
        ctx.exit(1)

    site = create_app().site

    if discarded:
        site.cleanup_discarded()

    if unused_tags:
        site.cleanup_tags()
        site.cleanup_relations()
1146792
def _cleanup_fd(self, fd, close=False):
        
        self._ioloop.remove_handler(fd)
        if fd in self._connections:
            try:
                self._pool_manager.free(self.pid, self._connections[fd])
            except pool.ConnectionNotFoundError:
                pass
            if close:
                self._connections[fd].close()
            del self._connections[fd]
        if fd in self._futures:
            del self._futures[fd]
962162
def delete(query_url,
               headers: {},
               parameters: {})
      HttpRequest.new(HttpMethodEnum::DELETE,
                      query_url,
                      headers: headers,
                      parameters: parameters)
    end
959117
function(fn, context){
      var cursor = this;
      var prev;

      while (prev = cursor, cursor = cursor.handler)
        if (cursor.fn === fn && cursor.context === context)
        {
          // make it non-callable
          cursor.fn = $undef;
          cursor.destroy = cursor.destroy && $undef;

          // remove from list
          prev.handler = cursor.handler;

          return;
        }

      /** @cut */ consoleMethods.warn('basis.Token#detach: fn & context pair not found, nothing was removed');
    }
448702
def write(self, path, wrap_ttl=None, **kwargs):
        """"""
        path = sanitize_mount(path)
        val = None
        if path.startswith('cubbyhole'):
            self.token = self.initial_token
            val = super(Client, self).write(path, wrap_ttl=wrap_ttl, **kwargs)
            self.token = self.operational_token
        else:
            super(Client, self).write(path, wrap_ttl=wrap_ttl, **kwargs)

        return val
421212
function promisifyClose(ZipFile, Promise) {
	const close = ZipFile.prototype.close;

	ZipFile.prototype.close = function() {
		return new Promise((resolve, reject) => {
			if (getError(this)) return rejectWithStoredError(this, reject);
			if (!this.isOpen) return resolve();
			if (getState(this)) return reject(new Error('Previous operation has not completed yet'));

			setState(this, {action: 'close', resolve, reject});
			close.call(this);
		});
	};
}
919918
function cleanup(err, compacted, activeCtx, options) {
    if(err) {
      return callback(err);
    }

    if(options.compactArrays && !options.graph && _isArray(compacted)) {
      // simplify to a single item
      if(compacted.length === 1) {
        compacted = compacted[0];
      }
      // simplify to an empty object
      else if(compacted.length === 0) {
        compacted = {};
      }
    }
    // always use array if graph option is on
    else if(options.graph && _isObject(compacted)) {
      compacted = [compacted];
    }

    // follow @context key
    if(_isObject(ctx) && '@context' in ctx) {
      ctx = ctx['@context'];
    }

    // build output context
    ctx = _clone(ctx);
    if(!_isArray(ctx)) {
      ctx = [ctx];
    }
    // remove empty contexts
    var tmp = ctx;
    ctx = [];
    for(var i = 0; i < tmp.length; ++i) {
      if(!_isObject(tmp[i]) || Object.keys(tmp[i]).length > 0) {
        ctx.push(tmp[i]);
      }
    }

    // remove array if only one context
    var hasContext = (ctx.length > 0);
    if(ctx.length === 1) {
      ctx = ctx[0];
    }

    // add context and/or @graph
    if(_isArray(compacted)) {
      // use '@graph' keyword
      var kwgraph = _compactIri(activeCtx, '@graph');
      var graph = compacted;
      compacted = {};
      if(hasContext) {
        compacted['@context'] = ctx;
      }
      compacted[kwgraph] = graph;
    }
    else if(_isObject(compacted) && hasContext) {
      // reorder keys so @context is first
      var graph = compacted;
      compacted = {'@context': ctx};
      for(var key in graph) {
        compacted[key] = graph[key];
      }
    }

    callback(null, compacted, activeCtx);
  }
636755
def _wrap(self, value, priority=0):
        

        if not callable(value):
            raise TypeError("Only callable values can be stored in CallbackContainer")

        elif self.is_bound_method(value):

            # We are dealing with a bound method. Method references aren't
            # persistent, so instead we store a reference to the function
            # and instance.

            value = (weakref.ref(value.__func__),
                     weakref.ref(value.__self__, self._auto_remove),
                     priority)

        else:

            value = (value, priority)

        return value
757406
function performRemove() {
        ClientModelDocService.remove(vm.clientModelDoc)
          .then(deleteClientModelDocSuccess)
          .catch(deleteClientModelDocCatch);

        function deleteClientModelDocSuccess() {
          Toast.show({type: 'success', text: 'ClientModelDoc ' + vm.displayName + ' deleted'});
          vm.showList();
        }

        function deleteClientModelDocCatch(err) {
          Toast.show({
            type: 'warn',
            text: 'Error while deleting clientModelDoc ' + vm.displayName,
            link: {state: $state.$current, params: $stateParams}
          });

          if (form && err) {
            form.setResponseErrors(err, vm.errors);
          }
        }
      }
46347
def process_predelete(self, obj, pk_set=None, action=None, update_fields=None, **kwargs):
        """"""
        build_kwargs = self._get_build_kwargs(obj, pk_set, action, update_fields, **kwargs)
        self.delete_cache.set(obj, build_kwargs)
477589
function(spirit) {
		var all = this._spirits;
		var key = spirit.$instanceid;
		if (!all.inside[key]) {
			if (all.outside[key]) {
				delete all.outside[key];
			}
			all.inside[key] = spirit;
			all.incoming.push(spirit);
			gui.Tick.dispatch(gui.$TICK_INSIDE, 4, this.$contextid);
		}
	}
178299
def register_cleanup(cleanup):
    """"""

    if not callable(cleanup):
        # Allow decorating a class with a `cleanup` classm ethod.
        cleanup = cleanup.cleanup

    CLEANUP_FUNCTIONS.append(cleanup.cleanup)
    return cleanup
1051308
def clean_up(self):
        '''  '''
        self.socket.close()
        for h in self.capture_handlers:
            h['logger'].close()