Delete an item.

        When ``href`` is ``None``, delete the collection.
438262
def delete(self, href=None):
        
        if self.is_fake:
            return

        if href is None:
            self.collection.delete()
            return

        item = self.get(href)
        if item is None:
            raise ComponentNotFoundError(href)

        item.etesync_item.delete()
266427
function deleteItem(id) {
  return new Promise((resolve, reject) => {
    return instance.pkgs.then(db => {
      const req = db.transaction(db.name, 'readwrite')
        .objectStore(db.name).delete(id);
      req.onerror = event => reject(event);
      req.onsuccess = () => resolve();
    });
  });
}
345944
def delete(self, *raw_args, **raw_kwargs):
        
        args = self.prepare_args(*raw_args)
        kwargs = self.prepare_kwargs(**raw_kwargs)
        key = self.key(*args, **kwargs)
        item = self.cache.get(key)
        if item is not None:
            self.cache.delete(key)
55887
def remove(self, item):
        '''
        '''
        score = self._dict.pop(item, None)
        if score is not None:
            index = self._sl.rank(score)
            assert index >= 0, 'could not find start range'
            for i, v in enumerate(self._sl.range(index)):
                if v == item:
                    assert self._sl.remove_range(index + i, index+i + 1) == 1
                    return score
            assert False, 'could not find element'
158916
function deleteView(id, viewID) {
  return updateItem(id, item => {
    const pos = item.views.findIndex(e => e.viewID === viewID);
    item.views.splice(pos, 1);
    // prune orphaned collections
    const bin = {};
    item.dataset.forEach(e => { bin[e.collectionID] = 0; });
    item.views.forEach(view => {
      ['rows', 'items', 'nodes', 'edges']
        .filter(e => view.hasOwnProperty(e))
        .forEach(e => { bin[view[e]] += 1; });
    });
    Object.entries(bin).forEach(entry => {
      if (!entry[1]) {
        const i = item.dataset.findIndex(e => e.collectionID === entry[0]);
        item.dataset.splice(i, 1);
      }
    });
  });
}
963546
async def delete(self, request, resource=None, **kwargs):
        
        if resource:
            resources = [resource]
        else:
            data = await self.parse(request)
            if data:
                resources = list(self.collection.where(self.meta.model_pk << data))

        if not resources:
            raise RESTNotFound(reason='Resource not found')

        for resource in resources:
            resource.delete_instance()
536664
public function deleteItem($id = null)
    {
        if ($id === null) {
            throw new ItemNotSelectedException;
        }
        $entity = $this->getById($id);
        $this->deleteEntity($entity);
    }
41075
def delete(item)
      data = read_file
      match_name(item)
      data.delete(@@item)
      write_file(data)
    end
538994
function deleteItem(entry) {
        var result = new $.Deferred();

        entry.moveToTrash(function (err) {
            if (!err) {
                DocumentManager.notifyPathDeleted(entry.fullPath);
                result.resolve();
            } else {
                _showErrorDialog(ERR_TYPE_DELETE, entry.isDirectory, FileUtils.getFileErrorString(err), entry.fullPath);

                result.reject(err);
            }
        });

        return result.promise();
    }
38127
function destroy(foPairs, index, collection, operand) {
  if (foPairs[index][collection].size === 1) {
    if (containsOne(foPairs[index])) {
      delete foPairs[index];
    } else {
      delete foPairs[index][collection];
    }
  }else {
    foPairs[index][collection].delete(operand);
  }
}
172124
def _closure_deletelink(self, oldparentpk):
        """"""
        self._closure_model.objects.filter(
            **{
                "parent__%s__child" % self._closure_parentref(): oldparentpk,
                "child__%s__parent" % self._closure_childref(): self.pk
            }
        ).delete()
216563
def tag_del(self, item, tag):
        
        tags = list(self.item(item, "tags"))
        if tag in tags:
            tags.remove(tag)
            self.item(item, tags=tuple(tags))
265169
def remove(self, item):
        
        self.items.pop(item)
        self._remove_dep(item)
        self.order = None
        self.changed(code_changed=True)
25998
function removeItem(itemName) {
  // TODO: Only remove used items
  if (data[itemName]) {
    data[itemName] = null;
  }
  if (localExists() && getItem(itemName)) {
    try {
      // Clear session storage
      window.sessionStorage.removeItem(itemName);
    } catch (error) {
      _logger2.default.warn({
        description: 'Error removing item from session storage', error: error,
        obj: 'storage', func: 'removeItem'
      });
    }
  }
}
1277131
def delete(collection_name, spec, safe, last_error_args):
    
    data = __ZERO
    data += bson._make_c_string(collection_name)
    data += __ZERO
    data += bson.BSON.encode(spec)
    if safe:
        (_, remove_message) = __pack_message(2006, data)
        (request_id, error_message) = __last_error(last_error_args)
        return (request_id, remove_message + error_message)
    else:
        return __pack_message(2006, data)
935842
def delete_item(self, item):
        '''  '''
        for relation in self.relations_of(item):
            self.delete_relation(item, relation)
        for origin, relation in self.relations_to(item, True):
            self.delete_relation(origin, relation, item)
        with self._write_lock:
            self._execute('''
                DELETE from objects where code=?
            ''', (self.serialize(item),))
            self.autocommit()
553489
function(event, model, collection, options) {
      if ((event == 'add' || event == 'remove') && collection != this) return;
      if (event == 'destroy') {
        this.remove(model, options);
      }
      if (model && event === 'change:' + model.idAttribute) {
        delete this._byId[model.previous(model.idAttribute)];
        this._byId[model.id] = model;
      }
      this.trigger.apply(this, arguments);
    }