Delete a collector from inventory.

        Args:
            collector_id (int): id of collector (optional)
557832
def delete(self, collector_id=None):
        
        cid = self.collector_id

        if collector_id:
            cid = collector_id

        # param to delete id
        url = '{0}/{1}'.format(self.url, cid)
        request = requests.delete(url, auth=self.auth)
        try:
            # unable to delete collector
            response = request.json()
        except ValueError:
            # returns when collector is deleted
            # apparently, the request does not return
            # a json response
            response = {
                u'message': u'The request completed successfully.',
                u'status': 200,
            }
        return response
141467
def delete_subscription(self, subscription_id):
        
        url = self.SUBSCRIPTIONS_ID_URL % subscription_id

        connection = Connection(self.token)
        connection.set_url(self.production, url)

        return connection.delete_request()
659969
def delete(self, request, _id):
        
        _id = deserialize(_id)

        to_delete = self.collection.get({'_id': _id})
        if to_delete:
            deleted = to_delete.delete()

            return Response(
                response=serialize(deleted),
                status=(
                    200 if not all(
                        key in deleted for key in [
                            'error_code', 'error_type', 'error_message'
                        ]
                    ) else 400
                )
            )
        else:
            return Response(
                response=serialize(
                    DocumentNotFoundError(self.collection.__name__, _id)
                ),
                status=404
            )
1190311
def delete_scan(self, scan_id):
        
        if self.get_scan_status(scan_id) == ScanStatus.RUNNING:
            return 0

        try:
            del self.scan_processes[scan_id]
        except KeyError:
            logger.debug('Scan process for %s not found', scan_id)
        return self.scan_collection.delete_scan(scan_id)
52236
public function canDelete($collection_id)
    {
        $sql = 'SELECT collection_item_id FROM collection_item WHERE collection_id=?';
        $result = $this->db->fetchColumn($sql, array($collection_id));
        return empty($result);
    }
357571
public function deleteID($ID)
    {
        if($this->offsetExists($this->safeOffset($ID))) {
            $this->offsetUnset($this->safeOffset($ID));
        } else {
            throw new CollectionIDNotFoundException('ID "' . $ID . '" does not exist in collection');
        }
    }
331773
def delete(self, id):
        
        self.conn.cursor().execute("DELETE FROM WeRoBot WHERE id=%s", (id, ))
        self.conn.commit()
380737
def delete(self, account_id, user_id):
        
        return self.connection.delete('account/access', account_id=account_id, user_id=user_id)
236478
def delete(self, key):
        """"""
        assert key, "A key must be supplied for delete operations"
        self._collection.remove(spec_or_id={'_id': key})
        LOG.debug("DB REMOVE: %s.%s", self.collection_name, key)
476634
def delete(self, object_id):
        
        obj = self.session.query(self.cls).filter_by(id=object_id).one()
        self.session.delete(obj)
        return obj
703941
def delete(self, run_id):
        
        self.generic_dao.delete_record(
            self.metrics_collection_name,
            {"run_id": self._parse_run_id(run_id)})
119240
public synchronized GoogleCloudStorageItemInfo removeItem(StorageResourceId id) {
    PrefixKey key = new PrefixKey(id.getBucketName(), id.getObjectName());
    CacheValue<GoogleCloudStorageItemInfo> value = itemMap.remove(key);

    if (value == null) {
      return null;
    }

    if (isExpired(value)) {
      cleanupLists(key);
      return null;
    }

    return value.getValue();
  }
544980
public function deleteCollectorResponse($collectorId, $responseId)
	{
		return $this->sendRequest(
			$this->createRequest('DELETE', sprintf('collectors/%s/responses/%s', $collectorId, $responseId))
		);
	}
241571
def delete(self):
        
        if not self.is_created():
            LOG.debug("Container was not created. Skipping deletion")
            return

        try:
            self.docker_client.containers\
                .get(self.id)\
                .remove(force=True)  # Remove a container, even if it is running
        except docker.errors.NotFound:
            # Container is already not there
            LOG.debug("Container with ID %s does not exist. Skipping deletion", self.id)
        except docker.errors.APIError as ex:
            msg = str(ex)
            removal_in_progress = ("removal of container" in msg) and ("is already in progress" in msg)

            # When removal is already started, Docker API will throw an exception
            # Skip such exceptions.
            if not removal_in_progress:
                raise ex

        self.id = None
1316122
def pool_delete(self, pool_id):
        
        return self._get('pools/{0}.json'.format(pool_id), method='DELETE',
                         auth=True)
879124
def remove(self, server_id):
        
        server = self._storage.pop(server_id)
        server.stop()
        server.cleanup()
1354280
def delete(collection_name, spec, safe,
           last_error_args, opts, flags=0):
    
    data = _ZERO_32
    data += bson._make_c_string(collection_name)
    data += struct.pack("<I", flags)
    encoded = bson.BSON.encode(spec, False, opts)
    data += encoded
    if safe:
        (_, remove_message) = __pack_message(2006, data)
        (request_id, error_message, _) = __last_error(collection_name,
                                                      last_error_args)
        return (request_id, remove_message + error_message, len(encoded))
    else:
        (request_id, remove_message) = __pack_message(2006, data)
        return (request_id, remove_message, len(encoded))