Delete a record from the database

        :param id: The id of the row to delete
        :type id: mixed

        :return: The number of rows deleted
        :rtype: int
496055
def delete(self, id=None):
        
        if id is not None:
            self.where('id', '=', id)

        sql = self._grammar.compile_delete(self)

        return self._connection.delete(sql, self.get_bindings())
631917
def remove(id_):
    
    with LOCK:
        thread = REGISTRY.pop(id_, None)
        if thread is not None:
            thread.cancel()

    return thread
1242797
def delete_attachment(self, id):
        
        url = self._get_url('attachment/' + str(id))
        return self._session.delete(url)
520145
public function delete($id): ?int
  {
    return $this->db->delete($this->class_cfg['table'], [$this->fields['id'] => $id]);
  }
1223305
def delete_component(self, id):
        
        url = self._get_url('component/' + str(id))
        return self._session.delete(url)
1270567
def delete_instance(self, uid):
        
        uri = "%s/%s" % (self.uri, uid)
        response, instance = self.request("DELETE", uri)
        return response.status == 204
653157
def _delete_record(self, identifier=None, rtype=None, name=None, content=None):
        """"""
        to_delete_ids = list()
        if identifier:
            to_delete_ids.append(identifier)
        else:
            for record in self._list_records(rtype=rtype, name=name, content=content):
                to_delete_ids.append(record["id"])

        for to_delete_id in to_delete_ids:
            self._request_delete_dns_record_by_id(to_delete_id)
        return True
749013
public void deleteById(String id) {
        final String sid = sessionPrefix + ":" + id;
        try {
            this.executor.execute(new RedisCallback<Void>() {
                public Void execute(Jedis jedis) {
                    jedis.del(sid);
                    return null;
                }
            });
        } catch (Exception e) {
            log.error("failed to delete session(key={}) in redis,cause:{}", sid, Throwables.getStackTraceAsString(e));
        }
    }
575815
def delete(self, request, id):
        
        if not id:
            # can't delete the whole container
            raise errors.MethodNotAllowed()
        try:
            models.User.objects.get(pk=id).delete()
        except models.User.DoesNotExist:
            # we never had it, so it's definitely deleted
            pass
970952
def delete(cls, id):
        '''
        
        '''
        client = cls._new_api_client()
        return client.make_request(cls, 'delete', url_params={'id': id})
231784
def delete(self):
        
        try:
            if self.exists() is False:
                return None
            self.db.session.delete(self)
            self.db.session.commit()
        except (Exception, BaseException) as error:
            # fail silently
            return None
1070043
def delete(self,removed):
        
        if isinstance(removed,dict):
            # remove a single record
            removed = [removed]
        else:
            # convert iterable into a list (to be able to sort it)
            removed = [ r for r in removed ]
        if not removed:
            return 0
        _ids = [ r['__id__'] for r in removed ]
        _ids.sort()
        keys = set(self.records.keys())
        # check if the records are in the base
        if not set(_ids).issubset(keys):
            missing = list(set(_ids).difference(keys))
            raise IndexError,'Delete aborted. Records with these ids' \
                ' not found in the base : %s' %str(missing)
        # raise exception if duplicate ids
        for i in range(len(_ids)-1):
            if _ids[i] == _ids[i+1]:
                raise IndexError,"Delete aborted. Duplicate id : %s" %_ids[i]
        deleted = len(removed)
        while removed:
            r = removed.pop()
            _id = r['__id__']
            # remove id from indices
            for indx in self.indices.keys():
                pos = bisect.bisect(self.indices[indx][r[indx]],_id)-1
                del self.indices[indx][r[indx]][pos]
                if not self.indices[indx][r[indx]]:
                    del self.indices[indx][r[indx]]
            # remove record from self.records
            del self.records[_id]
        return deleted
140465
def delete(self, id, seq, line): # pylint: disable=invalid-name,redefined-builtin
        
        return self.service.delete_id(self._base(id, seq), line)
1340735
private void remove(final String id, final StringBuilder sql) {
        sql.append("DELETE FROM ").append(getName()).append(" WHERE ").append(JdbcRepositories.getDefaultKeyName()).append(" = '").
                append(id).append("'");
    }
921186
def _delete_upload_id(conn: Connection, table: Table, upload_id: int) -> int:
        
        return conn.execute(delete(table).where(table.c.upload_id == upload_id)).rowcount if upload_id else 0
387
def delete(self, id):
        ''''''
        if not self._item_path:
            raise AttributeError('delete is not available for %s' % self._item_name)
        target = self._item_path % id
        self._redmine.delete(target)
        return None
1207923
def delete_record(self, identifier=None, rtype=None, name=None, content=None, **kwargs):
        
        if not rtype and kwargs.get('type'):
            warnings.warn('Parameter "type" is deprecated, use "rtype" instead.',
                          DeprecationWarning)
            rtype = kwargs.get('type')

        return self._delete_record(identifier=identifier, rtype=rtype, name=name, content=content)