This function tries to guess the columns to show from the given data
if [[columns]] are not explicitly specified.
324996
protected function _initAutoFilters()
    {
        //Если автоопределение колонок не включено
        if (!$this->isEnabledAutoFilters) {
            return $this;
        }

        if (!$this->dataProvider) {
            return $this;
        }

        $dataProvider = clone $this->dataProvider;
        $models = $dataProvider->getModels();


        /**
         * @var $model Model
         * @var $model ActiveRecord
         */
        $model = reset($models);

        if (!$model) {
            $modelClass = $dataProvider->query->modelClass;
            $model = new $modelClass();
        }

        $result = [];

        $result['attributeDefines'] = [];
        if (method_exists($model, 'attributes')) {
            $result['attributeDefines'] = $model->attributes();
        }

        $result['attributeLabels'] = [];
        if (method_exists($model, 'attributeLabels')) {
            $result['attributeLabels'] = $model->attributeLabels();
        }


        $rules = [];
        $fields = [];

        if ($model instanceof ActiveRecord) {
            foreach ($model::getTableSchema()->columns as $key => $column) {
                if (in_array($column->type, ['string', 'text'])) {
                    $fields[(string)$key] = [
                        'class' => StringFilterField::class,
                    ];

                    $rules[] = [(string)$key, 'safe'];
                } else if (in_array($column->type, ['integer', 'decimal'])) {

                    $realKey = $key;
                    if (!empty($key) && strcasecmp($key, 'id')) {
                        if (substr_compare($key, 'id', -2, 2, true) === 0) {
                            $key = rtrim(substr($key, 0, -2), '_');
                        } elseif (substr_compare($key, 'id', 0, 2, true) === 0) {
                            $key = ltrim(substr($key, 2, strlen($key)), '_');
                        }
                    }

                    $keyMany = Inflector::pluralize($key);

                    $keyName = lcfirst(Inflector::id2camel($key, '_'));
                    $keyManyName = lcfirst(Inflector::id2camel($keyMany, '_'));


                    if ($relation = $model->getRelation($keyName, false)) {
                        if ($relation->modelClass && $relation->link) {

                            $arr = array_keys($relation->link);
                            $idName = $arr[0];
                            $modelClassName = $relation->modelClass;

                            $query = $modelClassName::find();

                            if ($query->count() > 1000) {
                                $fields[(string)$realKey] = [
                                    'class' => NumberFilterField::class,
                                ];
                            } else {
                                $fields[(string)$realKey] = [
                                    'class'             => NumberFilterField::class,
                                    'isAllowChangeMode' => false,
                                    'field'             => [
                                        'class'    => SelectField::class,
                                        'items'    => function () use ($idName, $query) {

                                            return ArrayHelper::map(
                                                $query->all(),
                                                $idName,
                                                'asText'
                                            );
                                        },
                                        'multiple' => true,
                                    ],
                                ];
                            }

                        }

                    }

                    if (!isset($fields[(string)$realKey])) {
                        $fields[(string)$realKey] = [
                            'class' => NumberFilterField::class,
                        ];
                    }

                    $rules[] = [(string)$realKey, 'safe'];

                } else {
                    $fields[(string)$key] = [
                        'class' => StringFilterField::class,
                    ];

                    $rules[] = [(string)$key, 'safe'];
                }

            }
        } elseif (is_array($model) || is_object($model)) {
            foreach ($model as $name => $value) {
                if ($value === null || is_scalar($value) || is_callable([$value, '__toString'])) {
                    $fields[(string)$name] = [
                        'class' => StringFilterField::class,
                    ];

                    $rules[] = [(string)$name, 'safe'];
                }
            }
        }

        $result['rules'] = $rules;
        $result['fields'] = $fields;
        $this->_autoDynamicModelData = $result;

        return $this;
    }
1133317
def hiddenColumns( self ):
        
        output  = []
        columns = self.columns()
        for c, column in enumerate(columns):
            if ( not self.isColumnHidden(c) ):
                continue
            output.append(column)
        return output
1112410
def _validate_columns(self):
        '''
        
        '''
        for column_index in range(self.start[1], self.end[1]):
            table_column = TableTranspose(self.table)[column_index]

            column_type = None
            if self.end[0] > self.start[0]:
                column_type = get_cell_type(table_column[self.start[0]])

            num_type_changes = 0
            for row_index in range(self.start[0], self.end[0]):
                if not check_cell_type(table_column[row_index], column_type):
                    column_type = get_cell_type(table_column[row_index])
                    num_type_changes += 1
                if num_type_changes > 1:
                    self.flag_change(self.flags, 'warning', (row_index-1, column_index),
                                     self.worksheet, self.FLAGS['unexpected-change'])
                    # Decrement this to catch other cells which change again
                    num_type_changes -= 1
305628
def get_data_and_column_widths(self, data_kwargs, width_kwargs):
        
        data_kwargs = data_kwargs.copy()
        safe_str = data_kwargs.pop('safe_str', self._safe_str)
        list_of_list = [[safe_str(col, _is_header=True, **data_kwargs)
                         for col in self.columns]]
        list_of_list+= [[safe_str(row[col], **data_kwargs)
                         for col in self.columns] for row in self]
        column_widths = self._get_column_widths(list_of_list, **width_kwargs)
        return list_of_list, column_widths
244214
def parse_columns(lines):
    
    data = []
    index = []
    for line in lines:
        line = line.rstrip()
        if line.startswith("#"):
            tmp = __parse_entry(line)
            data.append(tmp[1])
            index.append(tmp[0])

    return DataFrame(data, index=index, columns=['description'])
98622
def __parseColumns(self):
        """"""
        columns = []
        if self.__dataItem.has_key('columnModel'):
            for column in self.__dataItem['columnModel']:
                columns.append(Column(column))
        return columns
605373
def guess_mode(self, data):
        
        # TODO: do we want to support dimensions being at the beginning of the array?
        if data.ndim == 2:
            return "L"
        elif data.shape[-1] == 3:
            return "RGB"
        elif data.shape[-1] == 4:
            return "RGBA"
        else:
            raise ValueError(
                "Un-supported shape for image conversion %s" % list(data.shape))
1217251
def column(self, col):
        
        if type(col) is str:
            for c in self._cols:
                if c.name == col:
                    return c
        else:
            return self._cols[col]
519028
def _sort_columns(self, columns_list):
        
        if not (all([x in columns_list for x in self._columns]) and all([x in self._columns for x in columns_list])):
            raise ValueError(
                'columns_list must be all in current columns, and all current columns must be in columns_list')
        new_sort = [self._columns.index(x) for x in columns_list]
        self._data = blist([self._data[x] for x in new_sort]) if self._blist else [self._data[x] for x in new_sort]
        self._columns = blist([self._columns[x] for x in new_sort]) if self._blist \
            else [self._columns[x] for x in new_sort]
117095
def column_stack_2d(data):
    """"""
    return list(list(itt.chain.from_iterable(_)) for _ in zip(*data))
298079
function () {
		var columns = this.columns,
			col = columns.length;

		while (col--) {
			this.parseColumn(columns[col], col);
		}

	}
454549
def print_arrays(data, cols)
      formatted_list = cli.list(data, :uneven_columns_across, cols)
      cli.say(formatted_list)
    end
1289677
def from_columns_dict(cls, columns):
        """"""
        warnings.warn("Table.from_columns_dict is deprecated. Use Table().with_columns(...)", FutureWarning)
        return cls().with_columns(columns.items())
1168360
def table_from_data(data, column_names):
    ""

    # The agate table is generated from a list of dicts, so the column order
    # from `data` is not preserved. We can use `select` to reorder the columns
    #
    # If there is no data, create an empty table with the specified columns

    if len(data) == 0:
        return agate.Table([], column_names=column_names)
    else:
        table = agate.Table.from_object(data, column_types=DEFAULT_TYPE_TESTER)
        return table.select(column_names)
262288
def choosers_columns_used(self):
        
        return list(tz.unique(tz.concatv(
            util.columns_in_filters(self.choosers_predict_filters),
            util.columns_in_filters(self.choosers_fit_filters))))
527246
def strip_columns(tab):
    """"""
    for colname in tab.colnames:
        if tab[colname].dtype.kind in ['S', 'U']:
            tab[colname] = np.core.defchararray.strip(tab[colname])
1229277
def columns=(array)
      $log.debug "tabular got columns #{array.count} #{array.inspect} " if $log
      @columns = array
      @columns.each_with_index { |c,i| 
        @chash[i] = ColumnInfo.new(c, c.to_s.length) 
        @cw[i] ||= c.to_s.length
        #@calign[i] ||= :left # 2011-09-27 prevent setting later on
      }
    end