Deletes a list of artifacts from the data store.
771930
def DeleteArtifactsFromDatastore(artifact_names, reload_artifacts=True):
  """"""
  artifacts_list = sorted(
      REGISTRY.GetArtifacts(reload_datastore_artifacts=reload_artifacts))

  to_delete = set(artifact_names)
  deps = set()
  for artifact_obj in artifacts_list:
    if artifact_obj.name in to_delete:
      continue

    if GetArtifactDependencies(artifact_obj) & to_delete:
      deps.add(str(artifact_obj.name))

  if deps:
    raise ValueError(
        "Artifact(s) %s depend(s) on one of the artifacts to delete." %
        (",".join(deps)))

  store = ArtifactCollection(rdfvalue.RDFURN("aff4:/artifact_store"))
  all_artifacts = list(store)

  filtered_artifacts, found_artifact_names = set(), set()
  for artifact_value in all_artifacts:
    if artifact_value.name in to_delete:
      found_artifact_names.add(artifact_value.name)
    else:
      filtered_artifacts.add(artifact_value)

  if len(found_artifact_names) != len(to_delete):
    not_found = to_delete - found_artifact_names
    raise ValueError("Artifact(s) to delete (%s) not found." %
                     ",".join(not_found))

  # TODO(user): this is ugly and error- and race-condition- prone.
  # We need to store artifacts not in a *Collection, which is an
  # append-only object, but in some different way that allows easy
  # deletion. Possible option - just store each artifact in a separate object
  # in the same folder.
  store.Delete()

  with data_store.DB.GetMutationPool() as pool:
    for artifact_value in filtered_artifacts:
      store.Add(artifact_value, mutation_pool=pool)

  if data_store.RelationalDBEnabled():
    for artifact_name in to_delete:
      data_store.REL_DB.DeleteArtifact(str(artifact_name))

  for artifact_value in to_delete:
    REGISTRY.UnregisterArtifact(artifact_value)
781138
def clear(self):
        
        collection = self.ds.connection(COLLECTION_MANAGED_PROCESS)
        return collection.delete_many(filter={})
958093
function clearDatabase() {
        var promises = [];

        _.each(resources, function (resource) {
            var service = pancakes.getService(resource.name);
            if (service.removePermanently) {
                log.info('purging ' + resource.name);
                promises.push(service.removePermanently({ where: {}, multi: true }));
            }
        });

        return Q.all(promises);
    }
532874
public void delete(List<?> entities) {
    try {
      entityManager.executeEntityListeners(CallbackType.PRE_DELETE, entities);
      Key[] nativeKeys = new Key[entities.size()];
      for (int i = 0; i < entities.size(); i++) {
        nativeKeys[i] = Marshaller.marshalKey(entityManager, entities.get(i));
      }
      nativeWriter.delete(nativeKeys);
      entityManager.executeEntityListeners(CallbackType.POST_DELETE, entities);
    } catch (DatastoreException exp) {
      throw DatastoreUtils.wrap(exp);
    }
  }
842168
private void cleanup() {
        Entry<K, V>[] tab = this.table;

        for (int i = tab.length ; i-- > 0 ;) {
            for (Entry<K, V> e = tab[i], prev = null; e != null; e = e.next) {
                if (e.get() == null) {
                    // Clean up after a cleared Reference.
                    this.modCount++;
                    if (prev != null) {
                        prev.next = e.next;
                    } else {
                        tab[i] = e.next;
                    }
                    this.count--;
                } else {
                    prev = e;
                }
            }
        }
    }
272750
public void clearPoints() {
		for (int i=1;i<list.size()-1;i++) {
			list.remove(1);
		}
		
		repaint(0);
		fireUpdate();
	}
1168753
def clean(self):
        
        self._table.clear()
        for item in self._usage_recency:
            self._usage_recency.remove(item)
646908
def cleanup_relations(self):
        """"""
        collections = self.collections
        for relation in [x for col in collections.values()
                         for x in col.model.relations.values()]:
            db.session.query(relation)\
                       .filter(~relation.listing.any())\
                       .delete(synchronize_session=False)
        db.session.commit()
972298
def _clean_data(data):
    '''
    
    '''
    for key in list(data):
        if key.startswith('__pub'):
            del data[key]
    return data
264984
public void removeAll()
    {
        if (m_gridList != null)
            m_gridList.removeAll();
        if (m_gridBuffer != null)
            m_gridBuffer.removeAll();
        if (m_gridNew != null)
            m_gridNew.removeAll();
        m_iEndOfFileIndex = UNKNOWN_POSITION;
        m_iPhysicalFilePosition = UNKNOWN_POSITION;
        m_iLogicalFilePosition = UNKNOWN_POSITION;
    }
45671
def clean(self, *args, **kwargs):
        """"""
        for key in list(self.store.keys()):
            self.unset(key)
260981
def delete_all_renditions(self):
        ''''''
        if self.renditions:
            for r in self.renditions.values():
                default_storage.delete(r)
            self.renditions = {}
1192979
def clear(self):
        
        for f in [x['content'] for x in self.metadata.values()]:
            os.remove(f)

        self.metadata = {}
        self._flush()
99806
def clear_collection(self, *classes):
		''' '''
		for c in classes:
			self.queue.append(ClearCollectionOp(self.transaction_id, self, c))
		if self.autoflush:
			self.flush()
512843
public void clear() {
		List<AbstractTable<?>> tableList = new ArrayList<AbstractTable<?>>(tables.values());
		for (AbstractTable<?> table : tableList) {
			table.clear();
		}
	}
826483
def delete(self, *names: str, pipeline=False):
        
        if pipeline:
            self._pipeline.delete(*names)
        else:
            self._db.delete(*names)
520418
def _flush_deletes(self, items, options):
    """"""
    datastore.Delete(items, config=self._create_config(options))