Work out which columns should be saved down.
163637
public function __calculateSaveDownRows()
    {
        if (!$this->_columns) {
            foreach (get_object_vars($this) as $potential_column => $discard) {
                switch ($potential_column) {
                    case 'table':
                    case substr($potential_column, 0, 1) == "_":
                        // Not a valid column
                        break;
                    default:
                        $this->_columns[] = $potential_column;
                        break;
                }
            }
        }

        // reorder the columns to match get_class_schema
        //TODO: Write test to verify that this works right.
        foreach ($this->getClassSchema() as $schemaKey => $dontCare) {
            if (in_array($schemaKey, $this->_columns)) {
                $sortedColumns[$schemaKey] = $schemaKey;
            }
        }
        foreach ($this->_columns as $column) {
            if (!isset($sortedColumns[$column])) {
                $class_name = get_called_class();
                throw new Exception("No type hinting/docblock found for '{$column}' in '{$class_name}'.", E_USER_WARNING);
            }
        }

        $this->_columns = array_values($sortedColumns);

        // Return sorted columns.
        return $this->_columns;
    }
1285126
def columns(self):
        
        fields = [f.label for f in self.form_fields
                  if self.cleaned_data["field_%s_export" % f.id]]
        if self.cleaned_data["field_0_export"]:
            fields.append(self.entry_time_name)
        return fields
863029
def _get_select_columns(self, columns=None):
        
        if columns == ["*"] or columns is None:
            columns = ["%s.*" % self._related.get_table()]

        return columns + ["%s.%s" % (self._parent.get_table(), self._first_key)]
715812
function() {
        this._calculateColumns();

        this.fireEvent('rendering');

        var element = this.element,
            items = this.items;

        // No items
        if (!items.length) {
            element.removeAttr('style');

        // Single column
        } else if (this.colCount <= 1) {
            element.removeAttr('style').addClass('no-columns');
            items.removeAttr('style');

        // Multi column
        } else {
            element.removeClass('no-columns');

            this._organizeItems();
            this._positionItems();
        }

        this.fireEvent('rendered');
    }
1205823
def _make_columns(columns: List[Union[int, str]]) -> List[Dict]:
        """"""
        return [dict(title=str(c),
                     dataIndex=str(c),
                     key=str(c))
                for c in columns]
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;
					}
				}
			}		
		}
	}
781933
def combine_columns(columns):
    
    columns_zipped = itertools.zip_longest(*columns)
    return ''.join(x for zipped in columns_zipped for x in zipped if x)
102160
def iter_left_col_tcs(self):
        """"""
        col_idx = self._left
        for tr in self._tbl.tr_lst[self._top:self._bottom]:
            yield tr.tc_lst[col_idx]
778698
def setCols(self, columns):
        
        self._raster[1] = columns
        if self._raster[0] == 0:
            self._raster[0] = 1
885574
private void coverColumn(ColumnHeader<ColumnName> col) {
    LOG.debug("cover " + col.head.name);
    // remove the column
    col.right.left = col.left;
    col.left.right = col.right;
    Node<ColumnName> row = col.down;
    while (row != col) {
      Node<ColumnName> node = row.right;
      while (node != row) {
        node.down.up = node.up;
        node.up.down = node.down;
        node.head.size -= 1;
        node = node.right;
      }
      row = row.down;
    }
  }
735589
function() {
        var columnWidths = this.coordColumnModel.getWidths(this.whichSide);
        var columns = this.columnModel.getVisibleColumns(this.whichSide, true);

        return {
            widths: columnWidths,
            columns: columns
        };
    }
1324307
function () {
		
		if (this.options.switchRowsAndColumns) {
			this.columns = this.rowsToColumns(this.columns);
		}

		// Interpret the info about series and columns
		this.getColumnDistribution();

		// Interpret the values into right types
		this.parseTypes();
		
		// Handle columns if a handleColumns callback is given
		if (this.parsed() !== false) {
		
			// Complete if a complete callback is given
			this.complete();
		}
		
	}
1236262
public function columns()
    {
        $this->hook->filter(
            "manage_edit-{$this->posttype->getModel()->getSlug()}_columns",
            [$this->posttype->getColumns(), 'setNames']
        )->dispatch();

        $this->hook->action(
            "manage_{$this->posttype->getModel()->getSlug()}_posts_custom_column",
            [$this->posttype->getColumns(), 'manageContent']
        )->dispatch();
    }
197372
function _checkAndTransformColumns (columns) {
  var returnValue = null;

  if (columns) {
    _checkColumns(columns);

    returnValue = {};
    Object.keys(columns).forEach(function (key) {
      returnValue[key] = _columnToSnakeCase(columns[key]);
    });
  }
  return returnValue;
}
782862
def check_columns(column, line, columns):
    
    return column <= min(len(line), max(columns))
329929
protected function prepareColumns()
	{
		// if the columns aren't set, we can't show this page
		// TODO: instead of dying, show the columns defined as visible on the model
		if (!isset($this->crud['columns']))
		{
			abort(500, "CRUD columns are not defined.");
		}

		// if the columns are defined as a string, transform it to a proper array
		if (!is_array($this->crud['columns']))
		{
			$current_columns_array = explode(",", $this->crud['columns']);
			$proper_columns_array = array();

			foreach ($current_columns_array as $key => $col) {
				$proper_columns_array[] = [
								'name' => $col,
								'label' => ucfirst($col) //TODO: also replace _ with space
							];
			}

			$this->crud['columns'] = $proper_columns_array;
		}
	}
578779
function(fields) {
      var columndefs = [];
    	for(var i = 0 ; i < fields.length ; i++) {
    		columndefs.push( this.fieldToColumndef(fields[i]) );
    	}
    	return columndefs;
   }