Writes all of our delete events to DynamoDB.
550307
def capture_delete_records(records):
    """"""
    for record in records:
        model = create_delete_model(record)
        if model:
            try:
                model.delete(condition=(CurrentVPCModel.eventTime <= record['detail']['eventTime']))
            except DeleteError:
                LOG.warning(f'[?] Unable to delete VPC. VPC does not exist. Record: {record}')
        else:
            LOG.warning(f'[?] Unable to delete VPC. VPC does not exist. Record: {record}')
978722
def user_write_events(self) -> List[str]:
        
        return [event_type for event_type, event in self.items if event.get_event_action()
                in event_actions.WRITE_ACTIONS]
390561
def create_delete_model(record):
    """"""
    data = cloudwatch.get_historical_base_info(record)

    # TODO get tech ID
    # Example::
    #    group_id = cloudwatch.filter_request_parameters('groupId', record)
    #    vpc_id = cloudwatch.filter_request_parameters('vpcId', record)
    #    group_name = cloudwatch.filter_request_parameters('groupName', record)

    tech_id = None
    arn = get_arn(tech_id, record['account'])

    log.debug('Deleting Dynamodb Records. Hash Key: {arn}'.format(arn=arn))

    # tombstone these records so that the deletion event time can be accurately tracked.
    data.update({
        'configuration': {}
    })

    items = list(Current{{cookiecutter.technology_slug | titlecase}}Model.query(arn, limit=1))

    if items:
        model_dict = items[0].__dict__['attribute_values'].copy()
        model_dict.update(data)
        model = Current{{cookiecutter.technology_slug | titlecase }}Model(**model_dict)
        model.save()
        return model
840630
protected void fireKNNsRemoved(DBIDs removals, DBIDs updates) {
    KNNChangeEvent e = new KNNChangeEvent(this, KNNChangeEvent.Type.DELETE, removals, updates);
    Object[] listeners = listenerList.getListenerList();
    for(int i = listeners.length - 2; i >= 0; i -= 2) {
      if(listeners[i] == KNNListener.class) {
        ((KNNListener) listeners[i + 1]).kNNsChanged(e);
      }
    }
  }
206194
def write_events(self, state_change_identifier, events, log_time):
        
        events_data = [
            (None, state_change_identifier, log_time, self.serializer.serialize(event))
            for event in events
        ]
        return super().write_events(events_data)
1069031
def delete(self, receiver_id=None, event_id=None):
        """"""
        event = self._get_event(receiver_id, event_id)
        event.delete()
        db.session.commit()
        return make_response(event)
551949
void deleteAll() {
        transactionTemplate.execute(new TransactionCallbackWithoutResult() {
            @Override
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                sessionFactory.getCurrentSession().createQuery("DELETE FROM VersionInfo").executeUpdate();
            }
        });
    }
172478
function deleteItem(model, options) {
	var request,
		deferred = new _.Deferred(),
		params = {
			Key: key.call( model ),
			TableName: model._tableName()
		};

	options || ( options = {} );
	wrapComplete( model, options );
	_.extend( params, options.dynamodb );

	if ( options.serializeDates !== false ) {
		// If the hash and/or range attributes are `Date` instance they must be serialized before sending the request.
		serializeAllDates( model, params.Key );
	}

	request = dynamo().deleteItem( params );

	request.on('complete', function (response) {
		var ctx = options.context || model;

		if ( response.error ) {
			deferred.rejectWith( ctx, [ response, options ] );
		} else {
			deferred.resolveWith( ctx, [ response, options ] );
		}
	});
	request.send();

	deferred.done( options.success ).fail( options.error ).always( options.complete );

	return deferred.promise( request );
}
23930
public synchronized void dump() {
        if (log.isDebugEnabled()) {
            log.debug("dumping allocations {}", events.size());
            for (Entry<BaseEvent, Info> entry : events.entrySet()) {
                log.debug("{} {}", entry.getKey(), entry.getValue().refcount);
            }
        }
    }
175867
def delete_event_matches(self, data=None):
        
        return self._post('event/%s/matches/delete_all' if data is None else 'event/%s/matches/delete', json.dumps(self.event_key) if data is None else json.dumps(data))
445704
def deregister_all(self, *events):
        
        if events:
            for event in events:
                self._handler_dict[event] = []
        else:
            self._handler_dict = {}
486601
final void closeAndRemoveAllDatabaseHandles() {
        for (Database databaseHandle : this.databaseHandles) {
            try {
                databaseHandle.close();
            } catch (EnvironmentFailureException | IllegalStateException ex) {
                LOGGER.log(Level.SEVERE,
                        "Error closing databases", ex);
            }
        }
        this.databaseHandles.clear();
    }
311786
def delete_all(self, model_class):
        '''
        '''
        assert hasattr(model_class, '_fields'), 'Not a valid model class'

        table = model_class.__name__.lower()
        with Session() as conn:
            SQL = f'DELETE FROM {table}'
            conn.cursor().execute(SQL)
            conn.commit()
1166087
@SafeVarargs
  public static void deleteAll(Table... tables) {
    foreach(tables, DBSetup::deleteAll, CallInfo.create());
  }
33585
public static function flushEvents(): void
    {
        $client = Hub::getCurrent()->getClient();

        if ($client instanceof Client) {
            $transportProperty = new \ReflectionProperty(Client::class, 'transport');
            $transportProperty->setAccessible(true);

            $transport = $transportProperty->getValue($client);

            if ($transport instanceof HttpTransport) {
                $closure = \Closure::bind(function () {
                    $this->cleanupPendingRequests();
                }, $transport, $transport);

                $closure();
            }
        }
    }
945549
private void cleanUpEventLists(DCache cache, HashMap invalidateIdEvents, HashMap invalidateTemplateEvents, ArrayList pushEntryEvents, ArrayList pushECFEvents,
                                   ArrayList aliasEntryEvents) { //245015

        // Remove invalidateByIdEvent if the CacheEntry is newer than the invalidate request.
        Iterator it = invalidateIdEvents.values().iterator();
        while (it.hasNext()) {
            InvalidateByIdEvent invalidateByIdEvent = (InvalidateByIdEvent) it.next();
            Object id = invalidateByIdEvent.getId();
            CacheEntry cacheEntry = cache.getEntryFromMemory(id); //245015
            // In PushPull mode, dmap.put() --> cache.invalidateAndSet() --> (1) get old value; (2) invalidate but not performing renounce id
            // in DRS's BatchUpdate. The not-InvalidateByIdEvent.INVOKE_DRS_RENOUNCE ('False') will be passed when creating InvalidateByEvent;
            // (3)put entry in memory and performing announce id in DRS's BatchUpdate. For this case, we need to keep both invalidate event
            // in the InvalidateIdEvents and id in the PushEntryEvents. 
            if (cacheEntry != null &&
                invalidateByIdEvent.getTimeStamp() < cacheEntry.getTimeStamp() &&
                invalidateByIdEvent.isInvokeDRSRenounce() == true) { //495487
                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, "cleanUpEventLists(): Filtered out InvalidateByIdEvent when cache entry is newer in memory cache. cacheName=" + cache.getCacheName() + " id=" + id);

                }
                it.remove();
            }
        }

        // check pushEntryEvents to see if id, data ids, or template are in invalidate lists
        it = pushEntryEvents.iterator();
        while (it.hasNext()) {
            boolean remove = false;
            CacheEntry cacheEntry = (CacheEntry) it.next();
            if (invalidateIdEvents.containsKey(cacheEntry.getIdObject())) {
                InvalidateByIdEvent invalidateByIdEvent = (InvalidateByIdEvent) invalidateIdEvents.get(cacheEntry.getIdObject());
                // In PushPull mode, dmap.put() --> cache.invalidateAndSet() --> (1) get old value; (2) invalidate but not performing renounce id
                // in DRS's BatchUpdate. The not-InvalidateByIdEvent.INVOKE_DRS_RENOUNCE ('False') will be passed when creating InvalidateByEvent;
                // (3)put entry in memory and performing announce id in DRS's BatchUpdate. For this case, we need to keep both invalidate event
                // in the InvalidateIdEvents and id in the PushEntryEvents. 
                if (invalidateByIdEvent.isInvokeDRSRenounce() == true) { //495487
                    remove = true;
                    if (tc.isDebugEnabled()) {
                        Tr.debug(tc,
                                 "cleanUpEventLists(): Filtered out pushEntryEvents when id is n invalidation list. cacheName=" + cache.getCacheName() + " id="
                                                 + cacheEntry.getIdObject());
                    }
                }
            }
            if (!remove) {
                Enumeration e = cacheEntry.getDataIds();
                while (e.hasMoreElements()) {
                    Object did = e.nextElement();
                    if (invalidateIdEvents.containsKey(did)) {
                        remove = true;
                        if (tc.isDebugEnabled()) {
                            Tr.debug(tc, "cleanUpEventLists(): Filtered out pushEntryEvents when dependency id is in invalidation list. cacheName=" + cache.getCacheName() + " id="
                                         + cacheEntry.getIdObject() + " depid=" + did);
                        }
                        break;
                    }
                }
            }
            if (!remove) {
                Enumeration e = cacheEntry.getTemplates();
                while (e.hasMoreElements()) {
                    Object template = e.nextElement();
                    if (invalidateIdEvents.containsKey(template)) {
                        remove = true;
                        if (tc.isDebugEnabled()) {
                            Tr.debug(tc, "cleanUpEventLists(): Filtered out pushEntryEvents when template is in invalidation list. cacheName=" + cache.getCacheName() + " id="
                                         + cacheEntry.getIdObject() + " template=" + template);
                        }
                        break;
                    }
                }
            }

            // Remove PUSH event if the ce is not serializable
            if (!remove && !cacheEntry.prepareForSerialization()) {
                // a msg was logged during the above call
                remove = true;
            }

            if (remove) {
                it.remove();
            }
        }

        // check aliasEntryEvents to see if id is in invalidate lists or 
        // the CacheEntry is newer than the add/remove alias request.
        it = aliasEntryEvents.iterator();
        while (it.hasNext()) {
            boolean remove = false;
            AliasEntry aliasEntry = (AliasEntry) it.next();
            if (invalidateIdEvents.containsKey(aliasEntry.id)) {
                remove = true;
            } else {
                Iterator it_ce = pushEntryEvents.iterator();
                while (it_ce.hasNext()) {
                    CacheEntry cacheEntry = (CacheEntry) it_ce.next();
                    if (cacheEntry.getIdObject().equals(aliasEntry.id)) {
                        if (cacheEntry.getTimeStamp() > aliasEntry.getTimeStamp()) {
                            remove = true;
                            if (tc.isDebugEnabled()) {
                                Tr.debug(tc, "cleanUpEventLists(): Filtered out aliasEntryEvents when cache entry is newer than alias request. cacheName=" + cache.getCacheName()
                                             + " id=" + cacheEntry.getIdObject());
                            }
                            break;
                        }
                    }
                }
            }
            if (remove) {
                it.remove();
            }
        }

        //check pushECFEvents to make sure they should not be invalidated
        it = pushECFEvents.iterator();
        while (it.hasNext()) {
            boolean remove = false;
            ExternalInvalidation externalCacheFragment = (ExternalInvalidation) it.next();

            Enumeration enumeration = externalCacheFragment.getTemplates();
            while (!remove && enumeration.hasMoreElements()) {
                String template = (String) enumeration.nextElement();
                if (invalidateTemplateEvents.containsKey(template)) {
                    remove = true;
                    if (tc.isDebugEnabled()) {
                        Tr.debug(tc, "cleanUpEventLists(): Filtered out pushECFEvents when template is in invalidation list. cacheName=" + cache.getCacheName() + " template="
                                     + template);
                    }
                }
            }

            enumeration = externalCacheFragment.getInvalidationIds();
            while (!remove && enumeration.hasMoreElements()) {
                String id = (String) enumeration.nextElement();
                if (invalidateIdEvents.containsKey(id)) {
                    remove = true;
                    if (tc.isDebugEnabled()) {
                        Tr.debug(tc, "cleanUpEventLists(): Filtered out pushECFEvents when invalidation id is in invalidation list. cacheName=" + cache.getCacheName() + " ide="
                                     + id);
                    }
                }
            }

            if (remove)
                it.remove();
        }

    }
19942
def delete_event(self, id, **data):
        
        
        return self.delete("/events/{0}/".format(id), data=data)