If a record matching the instance id exists in the database, delete it.
199975
def delete(self, response, **kwargs):
        '''
        
        '''
        response_cls = self._get_instance(**kwargs)
        if response_cls:
            _action_and_commit(response_cls, session.delete)
1195459
def delete(self, for_update=False):
        
        hash_key = self.get_hash_id()
        try:
            original_instance = self.load(hash_key, convert_key=False)
        except KeyError:
            return

        # Remove from the `all` index.
        all_index = self._query.all_index()
        all_index.remove(hash_key)

        # Remove from the secondary indexes.
        for field in self._indexes:
            for index in field.get_indexes():
                index.remove(original_instance)

        if not for_update:
            for field in self._fields.values():
                if isinstance(field, _ContainerField):
                    field._delete(self)

        # Remove the object itself.
        self.__database__.delete(hash_key)
14477
def del_instance(self, obj):
        
        to_remove = set()
        for wrkey, _obj in self.iter_instances():
            if obj is _obj:
                to_remove.add(wrkey)
        for wrkey in to_remove:
            del self[wrkey]
326673
def _delete_record(self, identifier=None, rtype=None, name=None, content=None):
        
        ids = []

        if identifier:
            ids.append(identifier)
        elif not identifier and rtype and name:
            records = self._list_records(rtype, name, content)
            if records:
                ids = [record["id"] for record in records]

        if ids:
            LOGGER.debug("delete_records: %s", ids)
            with localzone.manage(self.filename, self.origin, autosave=True) as zone:
                for hashid in ids:
                    zone.remove_record(hashid)  # pylint: disable=no-member
                    LOGGER.debug("delete_record: %s", hashid)

        return True
759971
def delete(self, name):
        
        if isinstance(name, (list, tuple)):
            for xx in name:
                self.delete(xx)
        else:
            if name in self._record_map:
                del self._record_map[name]
                self._record_list = [
                    r for r in self._record_list if r['name'] != name]
310411
protected void deleteRecord(Connection connection, String hash)
            throws SQLException {
        int id = selectRecordId(hash);
        if (id > 0) {
            String[] queries = new String[] { Query.DELETE_FILEHASHES,
                    Query.DELETE_METAS, Query.DELETE_CVES,
                    Query.DELETE_RECORD_ID };
            for (String query : queries) {
                PreparedStatement ps = setObjects(connection, query, id);
                ps.execute();
                ps.close();
            }
        }
    }
1152035
def delete_model(self, model):
        """"""
        try:
            if model.json is None:
                return True
            record = Record(model.json, model=model)
            record.delete()
            db.session.commit()
        except SQLAlchemyError as e:
            if not self.handle_view_exception(e):
                flash(_('Failed to delete record. %(error)s', error=str(e)),
                      category='error')
            db.session.rollback()
            return False
        return True
373420
def delete(self, doc_id: str) -> bool:
        """"""

        try:
            self.instance.delete(self.index, self.doc_type, doc_id)
        except RequestError as ex:
            logging.error(ex)
            return False
        else:
            return True
1094653
function(instance) {
      if (!instance.id) {
        throw new Error("delete(): `id` must be defined");
      }

      return api
        .one(config.entity, instance.id)
        .delete();
    }
372386
public void doRemove() throws DBException
    {
        super.doRemove();
        if (m_arrayCache != null)
            if (m_iLogicalIndex != -1)
                m_arrayCache.set(m_iLogicalIndex, null);    // Show the current record as deleted.
    }
382027
def DeleteInstance(r, instance, dry_run=False):
    

    return r.request("delete", "/2/instances/%s" % instance,
                     query={"dry-run": dry_run})
240277
def delete(self):
        
        if self.id:
            with Repo.db:
                Repo(self.__table).where(id=self.id).delete()
215435
def delete_record(self, record):
        
        try:
            self.session.delete(record)
            self.session.commit()
        except Exception as e:
            self.session.rollback()
            raise ProgrammingError(e)
        finally:
            self.session.close()
1346392
@Transactional
    public void delete(E entity) {
        if (entityManager.contains(entity)) {
            entityManager.remove(entity);
        } else {
            // could be a delete on a transient instance
            E entityRef = entityManager.getReference(type, entity.getId());

            if (entityRef != null) {
                entityManager.remove(entityRef);
            } else {
                log.warning("Attempt to delete an instance that is not present in the database: " + entity);
            }
        }
    }
1231718
public function remove($id, $instanceName)
    {
        $this->getConnection()->table($this->getTableName())
            ->where('id', $id)
            ->where('instance', $instanceName)
            ->delete();
    }
510288
def delete(options = {})
      options = options.merge(db_snapshot_identifier: @snapshot_id)
      resp = @client.delete_db_snapshot(options)
      DBSnapshot.new(
        instance_id: resp.data.db_snapshot.db_instance_identifier,
        snapshot_id: resp.data.db_snapshot.db_snapshot_identifier,
        data: resp.data.db_snapshot,
        client: @client
      )
    end
762128
public function delete_instance() {
        global $DB;
        $grades = $DB->get_records('assign_grades', array('assignment'=>$this->assignment->get_instance()->id), '', 'id');
        if ($grades) {
            list($gradeids, $params) = $DB->get_in_or_equal(array_keys($grades), SQL_PARAMS_NAMED);
            $DB->delete_records_select('assignfeedback_editpdf_annot', 'gradeid ' . $gradeids, $params);
            $DB->delete_records_select('assignfeedback_editpdf_cmnt', 'gradeid ' . $gradeids, $params);
        }
        return true;
    }