Is flag in column_value on?
4101
def flag_on?(column_value, bitset, flag)
      val = column_value || 0
      (val & bitset.const_get(flag)) != 0
    end
233063
def resort(self, columnName):
        
        csc = self.currentSortColumn
        newSortColumn = self.columns[columnName]
        if newSortColumn is None:
            raise Unsortable('column %r has no sort attribute' % (columnName,))
        if csc is newSortColumn:
            self.isAscending = not self.isAscending
        else:
            self.currentSortColumn = newSortColumn
            self.isAscending = True
        return self.isAscending
601171
public function lt($value, bool $is_column = false): WhereStatement
    {
        return $this->lessThan($value, $is_column);
    }
1056377
def append_flag_values(self, flag_values):
    
    for flag_name, flag in six.iteritems(flag_values._flags()):  # pylint: disable=protected-access
      # Each flags with short_name appears here twice (once under its
      # normal name, and again with its short name).  To prevent
      # problems (DuplicateFlagError) with double flag registration, we
      # perform a check to make sure that the entry we're looking at is
      # for its normal name.
      if flag_name == flag.name:
        try:
          self[flag_name] = flag
        except _exceptions.DuplicateFlagError:
          raise _exceptions.DuplicateFlagError.from_flag(
              flag_name, self, other_flag_values=flag_values)
27869
def flags(self, index):
        
        if index.column() == 1:
            return QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEditable
        else:
            return QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable
1318241
def FlagValuesDict(self):
    """"""
    flag_values = {}

    for flag_name in self.RegisteredFlags():
      flag = self.FlagDict()[flag_name]
      flag_values[flag_name] = flag.value

    return flag_values
850164
@Override
    protected boolean isColumnVisible(int colFlag) {

        if (colFlag == LIST_COLUMN_TYPEICON.hashCode()) {
            return true;
        }
        if (colFlag == LIST_COLUMN_NAME.hashCode()) {
            return true;
        }
        if (colFlag == CmsUserSettings.FILELIST_TITLE) {
            return true;
        }
        if (colFlag == CmsUserSettings.FILELIST_DATE_LASTMODIFIED) {
            return true;
        }
        return false;
    }
678394
def select_where(self, where_col_list, where_value_list, col_name=''):
        
        res = []        # list of rows to be returned
        col_ids = []    # ids of the columns to check
        #print('select_where  : arr = ',  len(self.arr), 'where_value_list = ',  where_value_list)
        for col_id, col in enumerate(self.header):
            if col in where_col_list:
                col_ids.append([col_id, col])
        #print('select_where    : col_ids = ',  col_ids)   # correctly prints [[0, 'TERM'], [2, 'ID']]
        
        for row_num, row in enumerate(self.arr):
            keep_this_row = True
            #print('col_ids=', col_ids, ' row = ', row_num, row)
            for ndx, where_col in enumerate(col_ids):
                #print('type where_value_list[ndx] = ', type(where_value_list[ndx]))
                #print('type row[where_col[0]] = ', type(row[where_col[0]]))
                
                if row[where_col[0]] != where_value_list[ndx]:
                    keep_this_row = False
            if keep_this_row is True:
                if col_name == '':
                    res.append([row_num, row])
                else:   # extracting a single column only
                    l_dat = self.get_col_by_name(col_name)
                    if l_dat is not None:
                        res.append(row[l_dat])
        return res
1045539
private String redisColumnKey(SqlpKit.FLAG flag) {
		StringBuilder key = new StringBuilder(this._getUsefulClass().toGenericString());
		String[] attrs = this._getAttrNames();
		Object val;
		for (String attr : attrs) {
			val = this.get(attr);
			if (null == val) {
				continue;
			}
			key.append(val.toString());
		}
		key = new StringBuilder(HashKit.md5(key.toString()));
		if (flag.equals(SqlpKit.FLAG.ONE)) {
			return "data:"+key;
		}
		return "datas:"+key;
	}
105461
def add_flag_values(self, entry, flag):
        '''  '''
        if flag in self.flags:
            self.flags[flag].append(entry)
15467
protected function _checkFlags( $value )
	{
		$value = (int) $value;

		if( $value < MShop_Order_Item_Base_Product_Abstract::FLAG_NONE ||
			$value > MShop_Order_Item_Base_Product_Abstract::FLAG_IMMUTABLE ) {
				throw new MShop_Order_Exception( sprintf( 'Flags "%1$s" not within allowed range', $value ) );
		}
	}
1371760
def format_value(column_dict, value, key=None):
    
    formatter = column_dict.get('formatter')
    prop = column_dict['__col__']

    res = value

    if value in ('', None,):
        res = ''

    elif formatter is not None:
        res = formatter(value)

    else:
        if hasattr(prop, "columns"):
            sqla_column = prop.columns[0]
            column_type = getattr(sqla_column.type, 'impl', sqla_column.type)

            formatter = FORMATTERS_REGISTRY.get_formatter(column_type, key)
            if formatter is not None:
                res = formatter(value)
    return res
661318
def _check_fill_title_column(self, column_index):
        '''
        
        '''
        # Determine if the whole column is titles
        table_column = TableTranspose(self.table)[column_index]
        prior_column = TableTranspose(self.table)[column_index-1] if column_index > 0 else table_column
        for row_index in range(self.start[0], self.end[0]):
            if is_num_cell(table_column[row_index]) or is_num_cell(prior_column[row_index]):
                return
        # Since we're a title row, stringify the column
        self._stringify_column(column_index)
1318787
private void checkIndices(int row, int col) {
        if (row < 0 || row >= rows)
            throw new ArrayIndexOutOfBoundsException("row: " + row);
        else if (col < 0 || col >= cols)
            throw new ArrayIndexOutOfBoundsException("column: " + col);
    }
870300
def columns_are_indexed(self, columns):
        
        for index in self._indexes.values():
            if index.spans_columns(columns):
                return True

        return False
1348413
void checkAddColumn(ColumnSchema col) {

        if (table.isText() && !table.isEmpty(session)) {
            throw Error.error(ErrorCode.X_S0521);
        }

        if (table.findColumn(col.getName().name) != -1) {
            throw Error.error(ErrorCode.X_42504);
        }

        if (col.isPrimaryKey() && table.hasPrimaryKey()) {
            throw Error.error(ErrorCode.X_42530);
        }

        if (col.isIdentity() && table.hasIdentityColumn()) {
            throw Error.error(ErrorCode.X_42525);
        }

        if (!table.isEmpty(session) && !col.hasDefault()
                && (!col.isNullable() || col.isPrimaryKey())
                && !col.isIdentity()) {
            throw Error.error(ErrorCode.X_42531);
        }
    }
956654
private void checkColumnSingletons(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++){
			if(vColPositions[col].length == 1){
				short row = vColPositions[col][0];
				log.debug("found column singleton at row " + row + ", col " + col);
				short[] vRowPositionsRow = vRowPositions[row];
				if(vRowPositionsRow.length < 2){
					continue;//this is a fixed variable
				}

				double ARcol = A.getQuick(row, col);
				double cCol = c.getQuick(col);
				boolean isCColNz = !isZero(cCol);
				double lbCol = lb.getQuick(col);
				double ubCol = ub.getQuick(col);
				boolean isLBUnbounded = isLBUnbounded(lbCol); 
				boolean isUBUnbounded = isUBUnbounded(ubCol);
				
				if(isLBUnbounded || isUBUnbounded){
					//bound on one of the optimal Lagrange multipliers.
					if(isLBUnbounded){
						if(isUBUnbounded){
							//table 2, row 1
							zlb.setQuick(col, 0);
							zub.setQuick(col, 0);
							ylb.setQuick(row, cCol / ARcol);
							yub.setQuick(row, cCol / ARcol);
						}else{
							if(ARcol > 0){
								//table 2, row 4
								zub.setQuick(col, 0);
								ylb.setQuick(row, cCol / ARcol);
							}else{
								//table 2, row 5
								zub.setQuick(col, 0);
								yub.setQuick(row, cCol / ARcol);
							}
						}
					}else{
						if(isUBUnbounded){
							if(ARcol > 0){
								//table 2, row 2
								zlb.setQuick(col, 0);
								yub.setQuick(row, cCol / ARcol);
							}else{
								//table 2, row 3
								zlb.setQuick(col, 0);
								ylb.setQuick(row, cCol / ARcol);
							}
						}
					}
					
					if(isLBUnbounded && isUBUnbounded){
						//free column singleton: one constraint and	one variable 
						//is removed from the problem without generating any fill-ins in A, 
						//although	the objective function is modified
						log.debug("free column singleton");
						//substitution into the objective function
						short[] xi = new short[vRowPositionsRow.length-1];
						double[] mi = new double[vRowPositionsRow.length - 1];
						int cntXi = 0;
						for (int j = 0; j < vRowPositionsRow.length; j++) {
							short nzJ = vRowPositionsRow[j];
							if (nzJ != col){
								xi[cntXi] = nzJ;
								mi[cntXi] = -A.getQuick(row, nzJ) / ARcol;
								cntXi++;
								if (isCColNz){
									c.setQuick(nzJ, c.getQuick(nzJ) - cCol * A.getQuick(row, nzJ) / ARcol);
								}
							}
						}
						//see Andersen & Andersen, eq (10) [that is incorrect!]
						addToPresolvingStack(new LinearDependency(col, xi, mi, b.getQuick(row)));
						for(short j = 0; j < vRowPositionsRow.length; j++){
							short column = vRowPositionsRow[j];//the nz column index
							if(column!=col && vColPositions[column].length == 1){
								//this is also a column singleton, we do not want an empty final column
								//so we fix the value of the variable
								//@TODO: fix this for unbounded bounds
								if(c.getQuick(column)<0){
									lb.setQuick(column, ub.getQuick(column));
								}else if(c.getQuick(column)>0){
									ub.setQuick(column, lb.getQuick(column));
								}else{
									ub.setQuick(column, lb.getQuick(column));
								}
								log.debug("found fixed variables: x[" + column + "]="+lb.getQuick(column));
								addToPresolvingStack(new LinearDependency(column, null, null, lb.getQuick(column)));
								pruneFixedVariable(column, c, A, b, lb, ub, ylb, yub, zlb, zub);
							}
							changeColumnsLengthPosition(column, vColPositions[column].length, vColPositions[column].length-1);
							vColPositions[column] = removeElementFromSortedArray(vColPositions[column], row);
							A.setQuick(row, column, 0.);
						}
						changeRowsLengthPosition(row, vRowPositions[row].length, 0);
						vRowPositions[row] = new short[]{};
						if(vColPositions[col].length > 0){
							log.debug("Expected empty column "+col+" but was not empty");
							throw new IllegalStateException("Expected empty column "+col+" but was not empty");
						}
						vColPositions[col] = new short[]{};
						ylb.setQuick(row, cCol / ARcol);//ok, but jet stated above
						yub.setQuick(row, cCol / ARcol);//ok, but jet stated above
						b.setQuick(row, 0);
						lb.setQuick(col, this.unboundedLBValue);
						ub.setQuick(col, this.unboundedUBValue);
						c.setQuick(col, 0);
						this.someReductionDone = true;
						continue;
					}
				}
				
				double impliedL;
				double impliedU;
				if(ARcol>0){
					impliedL = (b.getQuick(row) - h[row])/ARcol + ubCol;
					impliedU = (b.getQuick(row) - g[row])/ARcol + lbCol;
				}else{
					impliedL = (b.getQuick(row) - g[row])/ARcol + ubCol;
					impliedU = (b.getQuick(row) - h[row])/ARcol + lbCol;
				}
				boolean ifl = impliedL > lbCol;//do not use =, it will cause a loop
				boolean ifu = impliedU < ubCol;//do not use =, it will cause a loop
				if(ifl){
				  lb.setQuick(col, impliedL);//tighten the bounds
				  lbCol = impliedL;
				  this.someReductionDone = true;
				}
				if(ifu){
				  ub.setQuick(col, impliedU);//tighten the bounds
				  ubCol = impliedU;
				  this.someReductionDone = true;
				}
				boolean isImpliedFree = (ifl && ifu) || (isZero(impliedL - lbCol) && isZero(impliedU - ubCol));
								
				if(vRowPositionsRow.length == 2 || isImpliedFree){
					//substitution
					short y = -1;
					double q=0., m=0.;
					short[] xi = new short[vRowPositionsRow.length-1];
					double[] mi = new double[vRowPositionsRow.length-1];
					StringBuffer sb = new StringBuffer("x["+col+"]=");
					q = b.getQuick(row)/ARcol;
					sb.append(q);
					int cntXi = 0;
					for(int j=0; j<vRowPositionsRow.length; j++){
						short nzJ = vRowPositionsRow[j];  
						if(nzJ != col){
							double ARnzJ = A.getQuick(row, nzJ);
							m = -ARnzJ/ARcol;
							xi[cntXi] = nzJ;
							mi[cntXi] = m;
							cntXi++;
							sb.append(" + " + m + "*x["+nzJ+"]");
							if(isCColNz){
								//the objective function is modified
								double cc = c.getQuick(col) * ARnzJ / ARcol;
								c.setQuick(nzJ, c.getQuick(nzJ) - cc);
							}
							y = nzJ;
						}
					}
					addToPresolvingStack(new LinearDependency(col, xi, mi, q));
					
					if(vRowPositionsRow.length == 2){
					//NOTE: the row and the column are removed
						log.debug("doubleton equation combined with a column singleton: " + sb.toString());
						//x = m*y + q, x column singleton
						//addToDoubletonMap(col, y, m, q);
						//the bounds on the variable y are modified so	that the feasible region is unchanged even if the bounds on x are removed
						//y = x/m - q/m
						double lbY = lb.getQuick(y);
						double ubY = ub.getQuick(y);
						boolean isLBYUnbounded = isLBUnbounded(lbY);
						boolean isUBYUnbounded = isLBUnbounded(ubY);
						if(m>0){
							if(!isLBUnbounded){
								double l = lbCol/m - q/m;
								lb.setQuick(y, (isLBYUnbounded)? l : Math.max(lbY, l));
							}
							if(!isUBUnbounded){
								double u = ubCol/m - q/m;
								ub.setQuick(y, (isUBYUnbounded)? u : Math.min(ubY, u));
							}
						}else{
							if(!isUBUnbounded){
								double u = ubCol/m - q/m;
								lb.setQuick(y, (isLBYUnbounded)? u : Math.max(lbY, u));
							}
							if(!isLBUnbounded){
								double l = lbCol/m - q/m;
								ub.setQuick(y, (isUBYUnbounded)? l : Math.min(ubY, l));
							}
						}
						if(vColPositions[y].length == 1){
							//this is also a column singleton, we do not want an empty final column
							//so we fix the value of the variable
							if(c.getQuick(y)<0){
								if(isUBUnbounded(ub.getQuick(y))){
									throw new RuntimeException("unbounded problem");
								}
								lb.setQuick(y, ub.getQuick(y));
							}else if(c.getQuick(y)>0){
								if(isLBUnbounded(lb.getQuick(y))){
									throw new RuntimeException("unbounded problem");
								}
								ub.setQuick(y, lb.getQuick(y));
							}else{
								//any value is good
								if(isLBUnbounded(lb.getQuick(y)) && isUBUnbounded(ub.getQuick(y))){
									throw new RuntimeException("unbounded problem");
								}else if(!isLBUnbounded(lb.getQuick(y)) && !isUBUnbounded(ub.getQuick(y))){
									double d = (ub.getQuick(y)-lb.getQuick(y))/2;
									lb.setQuick(y, d);
									ub.setQuick(y, d);
								}else if(!isLBUnbounded(lb.getQuick(y))){
									ub.setQuick(y, lb.getQuick(y));
								}else{
									lb.setQuick(y, ub.getQuick(y));
								}
							}
						}
						//remove the bounds on col
						lb.setQuick(col, this.unboundedLBValue);
						ub.setQuick(col, this.unboundedUBValue);
						//remove the variable
						A.setQuick(row, col, 0.);
						A.setQuick(row, y, 0.);
						b.setQuick(row, 0.);
						changeColumnsLengthPosition(col, vColPositions[col].length, 0);
						vColPositions[col] = new short[]{};
						vRowPositionsRow = removeElementFromSortedArray(vRowPositionsRow, col);//just to have vRowPositionsRow[0] 
						changeRowsLengthPosition(row, vRowPositionsRow.length+1, vRowPositionsRow.length);
						changeColumnsLengthPosition(vRowPositionsRow[0], vColPositions[vRowPositionsRow[0]].length, vColPositions[vRowPositionsRow[0]].length-1);
						vColPositions[vRowPositionsRow[0]] = removeElementFromSortedArray(vColPositions[vRowPositionsRow[0]], row);
						vRowPositions[row] = new short[]{};
						this.someReductionDone = true;
						continue;
					} else {
						//NOTE: one constraint and	one variable is removed from the problem 
						//without generating any fill-ins in A, 
						//although the objective function is modified
						log.debug("implied free column singletons: " + sb.toString());
						ylb.setQuick(row, c.getQuick(col) / A.getQuick(row, col));//ok, but already stated above 
						yub.setQuick(row, c.getQuick(col) / A.getQuick(row, col));//ok, but already stated above
						for(short cc=0; cc<vRowPositions[row].length; cc++){
							short column = vRowPositions[row][cc];
							if(column == col){
								continue;
							}
							if(vColPositions[column].length == 1){
								//this is also a column singleton, we do not want an empty final column
								//so we fix the value of the variable
								if(c.getQuick(column)<0){
									//no problem of unbounded bound, this is an implied free column
									if(isUBUnbounded(ub.getQuick(column))){
										throw new RuntimeException("unbounded problem");
									}
									lb.setQuick(column, ub.getQuick(column));
								}else if(c.getQuick(column)>0){
									//no problem of unbounded bound, this is an implied free column
									if(isLBUnbounded(lb.getQuick(column))){
										throw new RuntimeException("unbounded problem");
									}
									ub.setQuick(column, lb.getQuick(column));
								}else{
									//no problem of unbounded bound, this is an implied free column
									if(isLBUnbounded(lb.getQuick(column)) || isUBUnbounded(ub.getQuick(column))){
										throw new RuntimeException("unbounded problem");
									}
									double d = (ub.getQuick(y) - lb.getQuick(y)) / 2;
									lb.setQuick(y, d);
									ub.setQuick(y, d);
								}
								log.debug("found fixed variables: x[" + column + "]="+lb.getQuick(column));
								addToPresolvingStack(new LinearDependency(column, null, null, lb.getQuick(column)));
								pruneFixedVariable(column, c, A, b, lb, ub, ylb, yub, zlb, zub);
							}
							changeColumnsLengthPosition(column, vColPositions[column].length, vColPositions[column].length-1);
							vColPositions[column] = removeElementFromSortedArray(vColPositions[column], row);
							A.setQuick(row, column, 0.);
						}
						A.setQuick(row, col, 0.);
						b.setQuick(row, 0);
						lb.setQuick(col, this.unboundedLBValue);
						ub.setQuick(col, this.unboundedUBValue);
						c.setQuick(col, 0);
						changeColumnsLengthPosition(col, vColPositions[col].length, 0);
						vColPositions[col] = new short[]{};
						changeRowsLengthPosition(row, vRowPositions[row].length, 0);
						vRowPositions[row] = new short[]{};
						this.someReductionDone = true;
						//checkProgress(c, A, b, lb, ub, ylb, yub, zlb, zub);
						continue;
					}
				}
			}		
		}
	}