Removes the item at the itemIndex.
            The item's finalize method is called before removing so it can close its resources.
331975
def deleteItemAtIndex(self, itemIndex):
        
        if not itemIndex.isValid():
            logger.debug("No valid item selected for deletion (ignored).")
            return

        item = self.getItem(itemIndex, "<no item>")
        logger.debug("deleteItemAtIndex: removing {}".format(item))

        parentIndex = itemIndex.parent()
        parentItem = self.getItem(parentIndex, altItem=self.invisibleRootItem)
        row = itemIndex.row()
        self.beginRemoveRows(parentIndex, row, row)
        try:
            parentItem.removeChild(row)
        finally:
            self.endRemoveRows()

        logger.debug("deleteItemAtIndex completed")
1199417
public function finalize()
    {
        @flock($this->getFileResource(), LOCK_UN);
        @fclose($this->getFileResource());
        @unlink($this->getFileName());
    }
1330884
def remove(self, index):
        
        data = self.data
        index = self._split(index)
        for j, c in enumerate(index):
            i = int(c) - 1
            if j + 1 == len(index):
                try:
                    del data[i]
                except IndexError:
                    raise NoItemError('.'.join(index))
            else:
                data = data[i][4]
1068979
function( item ) {
        $.console.assert(item, "[World.removeItem] item is required");

        var index = $.indexOf(this._items, item );
        if ( index === -1 ) {
            return;
        }

        item.removeHandler('bounds-change', this._delegatedFigureSizes);
        item.removeHandler('clip-change', this._delegatedFigureSizes);
        item.destroy();
        this._items.splice( index, 1 );
        this._figureSizes();
        this._needsDraw = true;
        this._raiseRemoveItem(item);
    }
1058056
function(){
    if (this.isClosed){ return; }

    this.triggerMethod('item:before:close');

    Marionette.View.prototype.close.apply(this, slice(arguments));

    this.triggerMethod('item:closed');
  }
517020
def closeCurrentItem(self):
        
        logger.debug("closeCurrentItem")
        currentItem, currentIndex = self.getCurrentItem()
        if not currentIndex.isValid():
            return

        # First we remove all the children, this will close them as well.
        self.model().removeAllChildrenAtIndex(currentIndex)

        # Close the current item. BaseRti.close will emit the self.model.sigItemChanged signal,
        # which is connected to RepoTreeView.onItemChanged.
        currentItem.close()
        self.dataChanged(currentIndex, currentIndex)
        self.collapse(currentIndex)
128566
public function removeItem($item)
    {
        if ($item instanceof AbstractEntity) {
            $item = $item->id;
        }
        foreach ($this->value as $index => $entity) {
            if ($entity->id == $item) {
                unset($this->value[$index]);

                return;
            }
        }
    }
1189460
def removeItem(self, regItem):
        
        check_class(regItem, ClassRegItem)
        logger.info("Removing {!r} containing {}".format(regItem.identifier, regItem.fullClassName))

        del self._index[regItem.identifier]
        idx = self._items.index(regItem)
        del self._items[idx]
18443
private void popLastItem() {
        KeyValue<K,V> lastKV = items.last();
        items.remove(lastKV);
        index.remove(lastKV.key);
    }
1189051
public function remove($itemId)
    {
        $items = &$this->items;

        foreach ($items as $position => $item) {
            if ($itemId === $item->id) {
                unset($items[$position]);
            }
        }
    }
1021545
public T removeItemAt(int index) {
        T item = get(index);
        removeItemAtIndex(index, true);
        return item;
    }
1030650
def remove_item(self, item):
        
        self.unindex_item(item)
        self.items.pop(item.uuid, None)
856350
function() {
			var _this = this;
			if (_this._engine.clear) {
				_this._engine.clear();
			}
			// for FF 3, fixed in FF 3.5
			else {
				for (var i = _this.length, key; 0 <= i; i -= 1) {
					key = _this._key(i);
					_this._removeItem(key);
				}
			}
		}
590780
def finalize(self):
        
        logger.debug("Finalizing: {}".format(self))

        # Disconnect signals
        self.collector.sigContentsChanged.disconnect(self.collectorContentsChanged)
        self._configTreeModel.sigItemChanged.disconnect(self.configContentsChanged)
        self.sigInspectorChanged.disconnect(self.inspectorSelectionPane.updateFromInspectorRegItem)
        self.customContextMenuRequested.disconnect(self.showContextMenu)
190473
def remove(self, item):
        
        if item not in self:
            raise ValueError('objectlist.remove(item) failed, item not in list')
        item_id = int(self._view_path_for(item))
        giter = self._iter_for(item)
        del self[giter]
        self.emit('item-removed', item, item_id)
340250
public void remove(StoreTxLogPosition storeTxLogPosition, IndexItem<K> index) {
        DataBlock dataBlock = NAME_BLOCK_MAP.get(index.getFileId());
        if (dataBlock == null) {
            return;
        }
        dataBlock.removeData(storeTxLogPosition, index.getFromIndex(), index.getLength());
    }
168481
def remove(self):
        
        if not self._is_item:
            raise TypeError("Should be called on an item, not ListNode's itself.")
        self.container.node_stack.remove(self)