Drop all columns present in ``slices`` from records
337225
def drop_columns(records, slices):
    
    for record in records:
        # Generate a set of indices to remove
        drop = set(i for slice in slices
                   for i in range(*slice.indices(len(record))))
        keep = [i not in drop for i in range(len(record))]
        record.seq = Seq(''.join(itertools.compress(record.seq, keep)), record.seq.alphabet)
        yield record
1256995
def unsetrange(self, keys=None, prefix=""):
        
        if keys is not None:
            keys = ['%s%s' % (prefix, key) for key in keys]
            self.cursor.execute('delete from kv where key in (%s)' % ','.join(['?'] * len(keys)), keys)
            if self.revision and self.cursor.rowcount:
                self.cursor.execute(
                    'insert into kv_revisions values %s' % ','.join(['(?, ?, ?)'] * len(keys)),
                    list(itertools.chain.from_iterable((key, self.revision, json.dumps('DELETED')) for key in keys)))
        else:
            self.cursor.execute('delete from kv where key like ?',
                                ['%s%%' % prefix])
            if self.revision and self.cursor.rowcount:
                self.cursor.execute(
                    'insert into kv_revisions values (?, ?, ?)',
                    ['%s%%' % prefix, self.revision, json.dumps('DELETED')])
397436
def delete_sql(table, filter):
    '''
    
    '''
    keys, values = _split_dict(filter)
    where = _pairs(keys)
    sql = 'DELETE FROM {} WHERE {}'.format(table, where)
    return sql, values
735094
def pad_chunk_columns(chunk):
    """"""
    columns = set()
    for record in chunk:
        columns.update(record.keys())
    for record in chunk:
        for column in columns:
            record.setdefault(column, None)
    return chunk
749022
def drop_empty(rows):
    
    return zip(*[col for col in zip(*rows) if bool(filter(bool, col[1:]))])
972298
def _clean_data(data):
    '''
    
    '''
    for key in list(data):
        if key.startswith('__pub'):
            del data[key]
    return data
1350331
def invert_delete_row2(self, key, value):
        
        self.rows = filter(lambda x: x.get(key) == x.get(value), self.rows)
670444
def _remove_column(self, name):
        
        self._columns = filter(lambda c: c.name != name, self._columns)

        return self
2788
def drop(self, names):
        """"""
        
        # drop lower dimension data
        self._data = self._data.drop(names, axis=0)
        # drop higher dimension data
        for name in names:
            if name in self._ho_data:
                _ = self._ho_data.pop(name)
817085
def _remove(self, ctx, table_name, record_id, column_values):
        
        vsctl_table = self._get_table(table_name)
        ovsrec_row = ctx.must_get_row(vsctl_table, record_id)
        for column, value in column_values:
            ctx.remove_column(ovsrec_row, column, value)
        ctx.invalidate_cache()
157250
def _drop(self, table, existing_tables=None):
        """"""
        # Retrieve list of existing tables for comparison
        existing_tables = existing_tables if existing_tables else self.tables

        # Only drop table if it exists
        if table in existing_tables:
            # Set to avoid foreign key errorrs
            self.execute('SET FOREIGN_KEY_CHECKS = 0')

            query = 'DROP TABLE {0}'.format(wrap(table))
            self.execute(query)

            # Set again
            self.execute('SET FOREIGN_KEY_CHECKS = 1')
            self._printer('\tDropped table {0}'.format(table))
1098528
def drop_all(self, **kwargs):
        
        conn = self.__get_conn__(**kwargs)
        conn.update_query("DROP ALL")
        self.loaded = []
        self.loaded_times = {}
208907
def delete_blank_columns!(*options)
      exceptions = extract_exceptions(options)

      (columns.map(&:key) - exceptions).each do |key|
        if rows.all? { |row| is_blank?(row[key]) || is_zero?(row[key]) } # rubocop:disable Style/IfUnlessModifier
          delete_column key
        end
      end
    end
1363647
def drop_index(self, table, column):
        """"""
        self.execute('ALTER TABLE {0} DROP INDEX {1}'.format(wrap(table), column))
        self._printer('\tDropped index from column {0}'.format(column))
273176
def iget_list_column_slice(list_, start=None, stop=None, stride=None):
    
    if isinstance(start, slice):
        slice_ = start
    else:
        slice_ = slice(start, stop, stride)
    return (row[slice_] for row in list_)
301689
def trim_slice(lines, slice_tuple):
    
    def _empty(line):
        return not line or line.strip() == '>'

    if not slice_tuple:
        return None

    slice_start, slice_end = slice_tuple

    if slice_start is None:
        slice_start = 0
    if slice_end is None:
        slice_end = len(lines)

    # Trim from beginning
    while slice_start < slice_end and _empty(lines[slice_start]):
        slice_start += 1

    # Trim from end
    while slice_end > slice_start and _empty(lines[slice_end-1]):
        slice_end -= 1

    return (slice_start, slice_end)
521633
private void removeDominatedColumns(DoubleMatrix1D c,
			DoubleMatrix2D A, DoubleMatrix1D b, 
			DoubleMatrix1D lb, DoubleMatrix1D ub, 
			DoubleMatrix1D ylb, DoubleMatrix1D yub,
			DoubleMatrix1D zlb, DoubleMatrix1D zub) {
		for(short col=0; col<this.vColPositions.length; col++){
			short[] vColPositionsCol = vColPositions[col];
			if(vColPositionsCol==null || vColPositionsCol.length==0){
				continue;
			}
			double e = 0.;
			double d = 0.;
			//it will be e <= d
			for(int i=0; i<vColPositionsCol.length; i++){
				short row = vColPositionsCol[i]; 
				double AIJ = A.getQuick(row, col);
				if(AIJ > 0){
					e += AIJ * ylb.getQuick(row); 
					d += AIJ * yub.getQuick(row);
				}else{
					e += AIJ * yub.getQuick(row); 
					d += AIJ * ylb.getQuick(row);
				}
			}
			
			double cmd = c.getQuick(col) - d;
			double cme = c.getQuick(col) - e;
			//logger.debug("cmd: " +cmd);
			//logger.debug("cme: " +cme);
			boolean isCmdPositive = cmd > 0 && !isZero(cmd);//strictly > 0
			boolean isCmeNegative = cme < 0 && !isZero(cme);//strictly < 0
			boolean isLBColUnbounded = isLBUnbounded(lb.getQuick(col));
			boolean isUBColUnbounded = isUBUnbounded(ub.getQuick(col));
			
			if(isCmdPositive || isCmeNegative){
			  //dominated column
				log.debug("found dominated column: " + col);
				if(isCmdPositive){
					zlb.setQuick(col, 0);
					if(isLBColUnbounded){
						log.debug("unbounded problem");
						throw new RuntimeException("unbounded problem");
					}
					ub.setQuick(col, lb.getQuick(col));
					log.debug("x[" + col + "]="+lb.getQuick(col));
					addToPresolvingStack(new LinearDependency(col, null, null, lb.getQuick(col)));
					pruneFixedVariable(col, c, A, b, lb, ub, ylb, yub, zlb, zub);
				}else if(isCmeNegative){
					zub.setQuick(col, 0);
					if(isUBColUnbounded){
						log.debug("unbounded problem");
						throw new RuntimeException("unbounded problem");
					}
					lb.setQuick(col, ub.getQuick(col));
					log.debug("x[" + col + "]="+ub.getQuick(col));
					addToPresolvingStack(new LinearDependency(col, null, null, ub.getQuick(col)));
					pruneFixedVariable(col, c, A, b, lb, ub, ylb, yub, zlb, zub);
				}
				continue;
			}
			
			//here we have cmd<=0 and cme>=0 (can even be unbounded)
			
			if(vColPositionsCol.length>1){//the column singletons are used to generate the bounds d and e and therefore they cannot be dropped with this test
				if(!isLBColUnbounded && isZero(cmd)){	
					//weakly dominated column, see A. & A. (27), (28)
					log.debug("found weakly dominated column: " + col);
					ub.setQuick(col, lb.getQuick(col));
					log.debug("x[" + col + "]="+lb.getQuick(col));
					addToPresolvingStack(new LinearDependency(col, null, null, lb.getQuick(col)));
					pruneFixedVariable(col, c, A, b, lb, ub, ylb, yub, zlb, zub);
					continue;
				}
				if(!isUBColUnbounded && isZero(cme)){	
					//weakly dominated column, see A. & A. (27), (28)
					log.debug("found weakly dominated column: " + col);
					lb.setQuick(col, ub.getQuick(col));
					log.debug("x[" + col + "]="+ub.getQuick(col));
					addToPresolvingStack(new LinearDependency(col, null, null, ub.getQuick(col)));
					pruneFixedVariable(col, c, A, b, lb, ub, ylb, yub, zlb, zub);
					continue;
				}
			}
			
			if(!isLBColUnbounded && isUBColUnbounded){
				//new bounds on the optimal Lagrange multipliers y
				for(int i=0; i<vColPositionsCol.length; i++){
					short row = vColPositionsCol[i]; 
					double AIJ = A.getQuick(row, col);
					if(AIJ > 0){
						if(!isUBUnbounded(cme/AIJ + ylb.getQuick(row))){
							log.debug("set new bounds on the optimal Lagrange multipliers: " + row);
							yub.setQuick(row, Math.min(yub.getQuick(row), cme/AIJ + ylb.getQuick(row)));
						}
					}else{
						if(!isLBUnbounded(cme/AIJ + yub.getQuick(row))){
							log.debug("set new bounds on the optimal Lagrange multipliers: " + row);
							ylb.setQuick(row, Math.max(ylb.getQuick(row), cme/AIJ + yub.getQuick(row)));
						}
					}
				}
			}
			if(isLBColUnbounded && !isUBColUnbounded){
			  //new bounds on the optimal Lagrange multipliers y
				for(int i=0; i<vColPositionsCol.length; i++){
					short row = vColPositionsCol[i]; 
					double AIJ = A.getQuick(row, col);
					if(AIJ > 0){
						if(!isLBUnbounded(cmd/AIJ + yub.getQuick(row))){
							log.debug("set new bounds on the optimal Lagrange multipliers: " + row);
							ylb.setQuick(row, Math.max(ylb.getQuick(row), cmd/AIJ + yub.getQuick(row)));
						}
					}else{
						if(!isUBUnbounded(cmd/AIJ + ylb.getQuick(row))){
							log.debug("set new bounds on the optimal Lagrange multipliers: " + row);
							yub.setQuick(row, Math.min(yub.getQuick(row), cmd/AIJ + ylb.getQuick(row)));
						}
					}
				}
			}
		}
	}