Deletes given dataset from index.

        Args:
            vid (str): dataset vid.
14592
def _delete(self, vid=None):
        

        assert vid is not None, 'vid argument can not be None.'
        writer = self.index.writer()
        writer.delete_by_term('vid', vid)
        writer.commit()
223802
def delete(self, index, doc_type, id, bulk=False, **query_params):
        
        if bulk:
            cmd = {"delete": {"_index": index, "_type": doc_type,
                              "_id": id}}
            self.bulker.add(json.dumps(cmd, cls=self.encoder))
            return self.flush_bulk()

        path = make_path(index, doc_type, id)
        return self._send_request('DELETE', path, params=query_params)
339255
def delete_video_source(id, factory_id, opts = {})
      data, _status_code, _headers = delete_video_source_with_http_info(id, factory_id, opts)
      return data
    end
1228408
def delete(dataset):
    """"""
    
    config = ApiConfig()
    client = ApiClient(config.host, config.app_id, config.app_secret)
    client.check_correct_host()
    client.delete(dataset)
    return ('Dataset {} has been deleted successfully'.format(dataset))
1143267
private function deleteExistingTerms($vid = null)
    {
        $termStorage = $this->entityTypeManager->getStorage('taxonomy_term');
        //Load all vocabularies
        $vocabularies = $this->getVocabularies();

        if ($vid === 'all') {
            $vid = array_keys($vocabularies);
        } else {
            $vid = [$vid];
        }

        foreach ($vid as $item) {
            $vocabulary = $vocabularies[$item];
            $terms = $termStorage->loadTree($vocabulary->id());

            if (empty($terms)) {
                $this->getIo()->error(
                    sprintf(
                        $this->trans('commands.taxonomy.term.delete.messages.nothing'),
                        $item
                    )
                );
            } else {
                foreach ($terms as $term) {
                    $treal = $termStorage->load($term->tid);

                    if ($treal !== null) {
                        $this->getIo()->info(
                            sprintf(
                                $this->trans('commands.taxonomy.term.delete.messages.processing'),
                                $term->name
                            )
                        );
                        $treal->delete();
                    }
                }
            }
        }
    }
260838
def removeContinuousSet(self, continuousSet):
        
        q = models.ContinuousSet.delete().where(
            models.ContinuousSet.id == continuousSet.getId())
        q.execute()
708609
def delete_dataset(ctx, dataset):
    

    service = ctx.obj.get('service')
    res = service.delete_dataset(dataset)

    if res.status_code != 204:
        raise MapboxCLIException(res.text.strip())
236314
def delete_last(self, num_to_delete=1):
        
        # check access level
        if self._access_mode == READ_ONLY_ACCESS:
            raise ValueError('Cannot delete datapoints with read-only access')

        # check num to delete
        if num_to_delete > self._num_datapoints:
            raise ValueError('Cannot remove more than the number of datapoints in the dataset')

        # compute indices
        last_datapoint_ind = self._num_datapoints - 1
        last_tensor_ind = last_datapoint_ind // self._datapoints_per_file
        new_last_datapoint_ind = self._num_datapoints - 1 - num_to_delete
        new_num_datapoints = new_last_datapoint_ind + 1

        new_last_datapoint_ind = max(new_last_datapoint_ind, 0)
        new_last_tensor_ind = new_last_datapoint_ind // self._datapoints_per_file

        # delete all but the last tensor
        delete_tensor_ind = range(new_last_tensor_ind+1, last_tensor_ind+1) 
        for tensor_ind in delete_tensor_ind:
            for field_name in self.field_names:
                filename = self.generate_tensor_filename(field_name, tensor_ind)
                os.remove(filename)

        # update last tensor
        dataset_empty = False
        target_tensor_size = new_num_datapoints % self._datapoints_per_file
        if target_tensor_size == 0:
            if new_num_datapoints > 0:
                target_tensor_size = self._datapoints_per_file
            else:
                dataset_empty = True

        for field_name in self.field_names:
            new_last_tensor = self.tensor(field_name, new_last_tensor_ind)
            while new_last_tensor.size > target_tensor_size:
                new_last_tensor.delete_last()
            filename = self.generate_tensor_filename(field_name, new_last_tensor_ind)
            new_last_tensor.save(filename, compressed=True)
            if not new_last_tensor.has_data:
                os.remove(filename)
                new_last_tensor.reset()
        
        # update num datapoints            
        if self._num_datapoints - 1 - num_to_delete >= 0:
            self._num_datapoints = new_num_datapoints
        else:
            self._num_datapoints = 0

        # handle deleted tensor
        self._num_tensors = new_last_tensor_ind + 1
        if dataset_empty:
            self._num_tensors = 0
881886
private void deleteDataset(String datasetId) throws IOException, InterruptedException {
    executeWithBackOff(
        client.datasets().delete(projectId, datasetId),
        String.format(
            "Error when trying to delete the temporary dataset %s in project %s. "
            + "Manual deletion may be required.",
            datasetId, projectId));
  }
735501
def delete_video(id, factory_id, opts = {})
      data, _status_code, _headers = delete_video_with_http_info(id, factory_id, opts)
      return data
    end
155500
def remove_dataset_from_collection(dataset_id, collection_id, **kwargs):
    
    collection_i = _get_collection(collection_id)
    collection_item = _get_collection_item(collection_id, dataset_id)
    if collection_item is None:
        raise HydraError("Dataset %s is not in collection %s.",
                                                    dataset_id,
                                                    collection_id)
    db.DBSession.delete(collection_item)
    db.DBSession.flush()

    db.DBSession.expunge_all()

    return 'OK'
128448
def partition_by_vid(self, ref):
        """"""
        from ambry.orm import Partition

        p = self.session.query(Partition).filter(Partition.vid == str(ref)).first()
        if p:
            return self.wrap_partition(p)
        else:
            return None
189839
def del_doc(self, doc):
        
        logger.info("Removing doc from the index: %s" % doc)
        doc = doc.clone()  # make sure it can be serialized safely
        self.docsearch.index.del_doc(doc)
801648
def unlink(self, definition, doc1, doc2) :
        ""
        links = self.database[definition].fetchByExample( {"_from": doc1._id,"_to" : doc2._id}, batchSize = 100)
        for l in links :
            self.deleteEdge(l)
139309
def delete_index_files(self):
        
        self.clear_cache()
        db_path = self.db.local_db_path()
        if exists(db_path):
            remove(db_path)
390454
def removeVariantSet(self):
        
        self._openRepo()
        dataset = self._repo.getDatasetByName(self._args.datasetName)
        variantSet = dataset.getVariantSetByName(self._args.variantSetName)

        def func():
            self._updateRepo(self._repo.removeVariantSet, variantSet)
        self._confirmDelete("VariantSet", variantSet.getLocalId(), func)
762945
def _cleanup(self, kill, verbose):
        
        if kill:
            removed_indices = self.g.prune()

            self.nout -= len(removed_indices)

            if verbose and removed_indices:
                print('Removing %s' % removed_indices)

            for j in removed_indices:
                self.inv_map.pop(j[0])