produce labeled columns present in a select().
427197
def _label_select_column(self, select, column,
                             populate_result_map,
                             asfrom, column_clause_args,
                             name=None,
                             within_columns_clause=True):
        """"""

        if column.type._has_column_expression and \
                populate_result_map:
            col_expr = column.type.column_expression(column)
            add_to_result_map = lambda keyname, name, objects, type_: \
                self._add_to_result_map(
                    keyname, name,
                    (column,) + objects, type_)
        else:
            col_expr = column
            if populate_result_map:
                add_to_result_map = self._add_to_result_map
            else:
                add_to_result_map = None

        if not within_columns_clause:
            result_expr = col_expr
        elif isinstance(column, elements.Label):
            if col_expr is not column:
                result_expr = compiler._CompileLabel(
                    col_expr,
                    column.name,
                    alt_names=(column.element,)
                )
            else:
                result_expr = col_expr

        elif select is not None and name:
            result_expr = compiler._CompileLabel(
                col_expr,
                name,
                alt_names=(column._key_label,)
            )

        elif \
                                                asfrom and \
                                                isinstance(column,
                                                           elements.ColumnClause) and \
                                        not column.is_literal and \
                                        column.table is not None and \
                        not isinstance(column.table, selectable.Select):
            result_expr = compiler._CompileLabel(col_expr,
                                                 elements._as_truncated(
                                                     column.name),
                                                 alt_names=(column.key,))
        elif (
                        not isinstance(column, elements.TextClause) and
                        (
                                    not isinstance(column,
                                                   elements.UnaryExpression) or
                                    column.wraps_column_expression
                        ) and
                    (
                                not hasattr(column, 'name') or
                                isinstance(column, functions.Function)
                    )
        ):
            result_expr = compiler._CompileLabel(col_expr, column.anon_label)
        elif col_expr is not column:
            # TODO: are we sure "column" has a .name and .key here ?
            # assert isinstance(column, elements.ColumnClause)
            result_expr = compiler._CompileLabel(col_expr,
                                                 elements._as_truncated(
                                                     column.name),
                                                 alt_names=(column.key,))
        else:
            result_expr = col_expr

        column_clause_args.update(
            within_columns_clause=within_columns_clause,
            add_to_result_map=add_to_result_map
        )
        return result_expr._compiler_dispatch(
            self,
            **column_clause_args
        )
309307
public function select($columns = [])
    {
        $expr = new ColumnExpression($this->sql);

        if ($columns instanceof Closure) {
            $columns($expr);
        } else {
            if (!is_array($columns)) {
                $columns = [$columns];
            }
            $expr->columns($columns);
        }
    }
1318030
function (sql) {
            var columns = this.__opts.columns, ret = "";
            if (columns && columns.length) {
                ret = " (" + columns.map(
                    function (c) {
                        return c.toString(this);
                    }, this).join(this._static.COMMA_SEPARATOR) + ")";
            }
            return ret;
        }
308987
def select_distinct(self, table, cols='*', execute=True):
        """"""
        return self.select(table, cols, execute, select_type='SELECT DISTINCT')
944239
def select(table, cols="*", where=(), group="", order=(), limit=(), **kwargs):
    """"""
    where = dict(where, **kwargs).items()
    sql, args = makeSQL("SELECT", table, cols, where, group, order, limit)
    return execute(sql, args)
406453
def selections(self):
        ""
        for key, value in self.pairs:
            if '__' in key:
                column, lookup = key.rsplit('__', 1)
            else:
                column = key
                lookup = 'exact'
            yield column, lookup, value
147526
public CharSequence getQueryColumns(String tabalis, SelectColumn selects) {
        if (selects == null) return tabalis == null ? "*" : (tabalis + ".*");
        StringBuilder sb = new StringBuilder();
        for (Attribute attr : this.attributes) {
            if (!selects.test(attr.field())) continue;
            if (sb.length() > 0) sb.append(',');
            sb.append(getSQLColumn(tabalis, attr.field()));
        }
        if (sb.length() == 0) sb.append('*');
        return sb;
    }
74004
def select(self, Class, set=None, recursive=True,  ignore=True):
        """"""
        if self.mode == Mode.MEMORY:
            for t in self.data:
                if Class.__name__ == 'Text':
                    yield t
                else:
                    for e in t.select(Class,set,recursive,ignore):
                        yield e
177736
function(results) {
        var rows = [];
        var cols = results.columns;
        
        var mapFirst = function(col) { return col.shift(); };
        
        while(cols.length > 0 && cols[0].length > 0) {
            rows.push(cols.map(mapFirst));   
        }
        
        results.rows = rows;
        return results;
    }
998179
def selectis(table, field, value, complement=False):
    """"""

    return selectop(table, field, value, operator.is_, complement=complement)
269444
def form_query(self, columns, options={}):
        
        from_cl = 'FROM'

        direct = options.get('direct', self.direct)
        if direct:
            if columns != '*':
                raise ProgrammingError("Column lists cannot be specified for a direct function call.")
            columns = ''
            from_cl = ''

        if len(self.args) >= 1:
            replace = ['%s' for x in range(len(self.args))]
            func = "%s(" % self.query_base + ",".join(replace) + ")"
        else:
            func = "%s()" % self.query_base

        return "SELECT %s %s %s" % (columns, from_cl, func)
492210
function select($column0=null, $_=null){
        $obj = new SelectRule(new Context($this->connection));
        if($column0 == null){
            $args = ['*'];
        }elseif(is_array($column0)){
            $args = $column0;
        }else{
            $args = func_get_args();
        }
        foreach ($args as &$arg){
            $arg = DB::wrap($arg);
            if($arg == '*'){
                continue;
            }
        }
        return $obj->select(implode(',', $args));
    }
1150942
public SelectBuilder columns(String... columns) {
    for (String column : columns) {
      column(column, null);
    }

    return this;
  }
1310735
def selectlt(table, field, value, complement=False):
    """"""

    value = Comparable(value)
    return selectop(table, field, value, operator.lt, complement=complement)
1191323
function (columns) {
        var i, j, k,
            totalCol = 0,
            flag = [];

        for (i = 0; i < columns[0].length; i++) {
            totalCol += columns[0][i].colspan || 1;
        }

        for (i = 0; i < columns.length; i++) {
            flag[i] = [];
            for (j = 0; j < totalCol; j++) {
                flag[i][j] = false;
            }
        }

        for (i = 0; i < columns.length; i++) {
            for (j = 0; j < columns[i].length; j++) {
                var r = columns[i][j],
                    rowspan = r.rowspan || 1,
                    colspan = r.colspan || 1,
                    index = $.inArray(false, flag[i]);

                if (colspan === 1) {
                    r.fieldIndex = index;
                    // when field is undefined, use index instead
                    if (typeof r.field === 'undefined') {
                        r.field = index;
                    }
                }

                for (k = 0; k < rowspan; k++) {
                    flag[i + k][index] = true;
                }
                for (k = 0; k < colspan; k++) {
                    flag[i][index + k] = true;
                }
            }
        }
    }
1229033
def loaded_columns(obj: BaseModel):
    """"""
    for column in sorted(obj.Meta.columns, key=lambda c: c.name):
        value = getattr(obj, column.name, missing)
        if value is not missing:
            yield column.name, value
748554
def _filter_rows(self, rows, visible_columns=None):
        """"""
        if visible_columns is None:
            visible_columns = self.visible_columns
        filtered_row = []
        for idx, name in enumerate(self.columns.keys()):
            if name in self.visible_columns:
                filtered_row.append(rows[idx])
        return filtered_row