Removes a given ngram from the databae. The ngram has to be in the
        database, otherwise this method will stop with an error.

        Parameters
        ----------
        ngram : iterable of str
            A list, set or tuple of strings.
544766
def remove_ngram(self, ngram):
        
        query = "DELETE FROM _{0}_gram".format(len(ngram))
        query += self._build_where_clause(ngram)
        query += ";"
        self.execute_sql(query)
98339
async def delete(self, iden):
        '''
        
        '''
        appt = self.appts.get(iden)
        if appt is None:
            raise s_exc.NoSuchIden()

        try:
            heappos = self.apptheap.index(appt)
        except ValueError:
            pass  # this is OK, just a non-recurring appt that has no more records
        else:
            # If we're already the last item, just delete it
            if heappos == len(self.apptheap) - 1:
                del self.apptheap[heappos]
            else:
                # put the last item at the current position and reheap
                self.apptheap[heappos] = self.apptheap.pop()
                heapq.heapify(self.apptheap)

        del self.appts[iden]
        await self._hivedict.pop(iden)
742387
def _generate_ngrams_with_context_helper(ngrams_iter: iter, ngrams_len: int) -> map:
        """"""
        return map(lambda term: (term[1], term[0], term[0] + ngrams_len), enumerate(ngrams_iter))
176963
def remove(self, *args):
        

        args = self.prepare_args(args)

        for index in self._indexes:
            index.remove(*args)
1255801
def delete(self, symbol):
        
        if isinstance(symbol, (str, unicode)):
            sym = self.get(symbol)
        elif isinstance(symbol, Symbol):
            sym = symbol
        else:
            raise Exception("Invalid symbol {}".format((repr(symbol))))

        # Has to handle the case where the table would exist already
        # and where it wouldn't.
        try:
            sym.datatable = Table(sym.name, Base.metadata, autoload=True)
            sym.datatable.drop(self.eng, checkfirst=True)
        except NoSuchTableError:
            print "No worries, {} never existed to begin with.".format(sym.name)

        self.ses.delete(sym)
        self.ses.commit()
793144
private static void deleteRange(
		RocksDB db,
		List<ColumnFamilyHandle> columnFamilyHandles,
		byte[] beginKeyBytes,
		byte[] endKeyBytes) throws RocksDBException {

		for (ColumnFamilyHandle columnFamilyHandle : columnFamilyHandles) {
			try (RocksIteratorWrapper iteratorWrapper = RocksDBOperationUtils.getRocksIterator(db, columnFamilyHandle);
				RocksDBWriteBatchWrapper writeBatchWrapper = new RocksDBWriteBatchWrapper(db)) {

				iteratorWrapper.seek(beginKeyBytes);

				while (iteratorWrapper.isValid()) {
					final byte[] currentKey = iteratorWrapper.key();
					if (beforeThePrefixBytes(currentKey, endKeyBytes)) {
						writeBatchWrapper.remove(columnFamilyHandle, currentKey);
					} else {
						break;
					}
					iteratorWrapper.next();
				}
			}
		}
	}
976616
def _load_ngram(name):
    
    module = importlib.import_module('lantern.analysis.english_ngrams.{}'.format(name))
    return getattr(module, name)
119177
private ArrayList<String> ngram(List tokens, int[] gramSizes2) {
        ArrayList<String> list = new ArrayList<String>();
        StringBuffer buf = new StringBuffer();
        for (int j = 0; j < gramSizes.length; j++) {
            int len = gramSizes[j];
            if (len <= 0 || len > tokens.size())
                continue;
            for (int i = 0; i < tokens.size() - len+1; i++) {
                buf.delete(0, buf.length());
                int k = 0;
                for(; k < len-1; ++k)   {
                    buf.append(tokens.get(i+k));
                    buf.append(' ');
                }
                buf.append(tokens.get(i+k));
                list.add(buf.toString().intern());
            }
        }
        return list;
    }
1208480
def remove(self):
        
        self.__bulk.add_delete(self.__selector, _DELETE_ALL,
                               collation=self.__collation)
689711
def delete(self, params, args, data):
        # type: (str, dict, dict) -> None
        
        ctx = self._create_context(params, args, data)
        row_id = ctx.get_row_id()

        if row_id is not None:
            return self._delete_one(row_id, ctx)
        else:
            return self._delete_collection(ctx)
319767
def remove_all(gset, elem):
    
    n = 0
    while True:
        try:
            remove_once(gset, elem)
            n = n + 1
        except RemoveError:
            return n
983512
public void removeAll()
    {
        if (m_aCurrentRecord != null)
        {
            for (int index = m_iCurrentRecordStart; index < m_iCurrentRecordEnd; index++)
            {
                int iArrayIndex = this.bufferToArrayIndex(index);
                Object bookmark = m_aCurrentRecord[iArrayIndex];
                if ((bookmark != null) && (bookmark != gEmptyCell))
                    this.freeElement(bookmark);
                m_aCurrentRecord[iArrayIndex] = gEmptyCell;   // No record here
            }
        }
        m_iCurrentRecordStart = 0;      // The first
        m_iCurrentRecordEnd = 0;        // One after the last (Use array nomenclature)
    }
1366343
def _get_word_ngrams(n, sentences):
    
    assert len(sentences) > 0
    assert n > 0

    words = _split_into_words(sentences)
    return _get_ngrams(n, words)
69413
def delete(self, where=None, start=None, stop=None, **kwargs):
        
        if com._all_none(where, start, stop):
            self._handle.remove_node(self.group, recursive=True)
            return None

        raise TypeError("cannot delete on an abstract storer")
941235
def ngrams(self, with_counts=False):
        
        query = "SELECT "
        for i in reversed(range(self.cardinality)):
            if i != 0:
                query += "word_{0}, ".format(i)
            elif i == 0:
                query += "word"

        if with_counts:
            query += ", count"

        query += " FROM _{0}_gram;".format(self.cardinality)

        result = self.execute_sql(query)
        for row in result:
            yield tuple(row)
88454
def _get_ngram_counter(ids, n):
  
  # Remove zero IDs used to pad the sequence.
  ids = [token_id for token_id in ids if token_id != 0]
  ngram_list = [tuple(ids[i:i + n]) for i in range(len(ids) + 1 - n)]
  ngrams = set(ngram_list)
  counts = collections.Counter()
  for ngram in ngrams:
    counts[ngram] = 1
  return counts
567246
def prune_by_ngram(self, ngrams):
        
        self._logger.info('Pruning results by n-gram')
        self._matches = self._matches[
            ~self._matches[constants.NGRAM_FIELDNAME].isin(ngrams)]