Given a list of column names will sort the DataFrame columns to match the given order

        :param columns_list: list of column names. Must include all column names
        :return: nothing
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]
726235
def sort(self, cmp=None, key=None, reverse=False):
        
        self._col_list.sort(cmp, key, reverse)
551598
def _by_columns(self, columns):
        
        return columns if self.isstr(columns) else self._backtick_columns(columns)
990200
def order_by(self, *colnames):
        
        if len(colnames) == 0:
            clone = copy.deepcopy(self)
            clone._order = []
            return clone

        conditions = []
        for colname in colnames:
            conditions.append('"{}" {}'.format(*self._get_ordering_condition(colname)))

        clone = copy.deepcopy(self)
        clone._order.extend(conditions)
        return clone
70944
def set_col_first(df, col_names):
        

        column_headings = df.columns
        column_headings = column_headings.tolist()
        try:
            for col_name in col_names:
                i = column_headings.index(col_name)
                column_headings.pop(column_headings.index(col_name))
                column_headings.insert(0, col_name)

        finally:
            df = df.reindex(columns=column_headings)
            return df
132209
def _get_select_columns(self, columns=None):
        
        if columns == ['*'] or columns is None:
            columns = ['%s.*' % self._related.get_table()]

        return columns + self._get_aliased_pivot_columns()
181277
def order_columns_in_row(fields, unordered_row):
    
    fields_idx = {f: pos for pos, f in enumerate(fields)}
    return OrderedDict(sorted(unordered_row.items(),
                              key=lambda i: fields_idx[i[0]]))
880293
def _to_list(sc, cols, converter=None):
    
    if converter:
        cols = [converter(c) for c in cols]
    return sc._jvm.PythonUtils.toList(cols)
924504
def get_orm_column_names(cls: Type, sort: bool = False) -> List[str]:
    
    colnames = [col.name for col in get_orm_columns(cls)]
    return sorted(colnames) if sort else colnames
157744
def setColumns(self, columns):
        
        super(XOrbTreeWidget, self).setColumns(columns)
        self.setFilteredColumns(range(len(columns)))
        self.assignOrderNames()
        self._columnsInitialized = True
165430
def order_string
      result = []

      @params['iSortingCols'].times do |count|
        col_index = @params["iSortCol_#{count}"]
        col_dir = @params["sSortDir_#{count}"]
        col_name = column_attributes.keys[col_index]
        result << " " + (col_name + " " + col_dir)
      end

      result.join(", ")
    end
1238984
def _list(self):
        
        if get_order_args().get(self.__class__.__name__):
            order_column, order_direction = get_order_args().get(
                self.__class__.__name__
            )
        else:
            order_column, order_direction = "", ""
        page = get_page_args().get(self.__class__.__name__)
        page_size = get_page_size_args().get(self.__class__.__name__)
        get_filter_args(self._filters)
        widgets = self._get_list_widget(
            filters=self._filters,
            order_column=order_column,
            order_direction=order_direction,
            page=page,
            page_size=page_size,
        )
        form = self.search_form.refresh()
        self.update_redirect()
        return self._get_search_widget(form=form, widgets=widgets)
910209
def _sort(self, session_groups):
    """"""

    # Sort by session_group name so we have a deterministic order.
    session_groups.sort(key=operator.attrgetter('name'))
    # Sort by lexicographical order of the _request.col_params whose order
    # is not ORDER_UNSPECIFIED. The first such column is the primary sorting
    # key, the second is the secondary sorting key, etc. To achieve that we
    # need to iterate on these columns in reverse order (thus the primary key
    # is the key used in the last sort).
    for col_param, extractor in reversed(list(zip(self._request.col_params,
                                                  self._extractors))):
      if col_param.order == api_pb2.ORDER_UNSPECIFIED:
        continue
      if col_param.order == api_pb2.ORDER_ASC:
        session_groups.sort(
            key=_create_key_func(
                extractor,
                none_is_largest=not col_param.missing_values_first))
      elif col_param.order == api_pb2.ORDER_DESC:
        session_groups.sort(
            key=_create_key_func(
                extractor,
                none_is_largest=col_param.missing_values_first),
            reverse=True)
      else:
        raise error.HParamsError('Unknown col_param.order given: %s' %
                                 col_param)
870300
def columns_are_indexed(self, columns):
        
        for index in self._indexes.values():
            if index.spans_columns(columns):
                return True

        return False
712567
def columns(self):
        
        return Index(np.array(self._gather_column_names(), dtype=np.bytes_), np.dtype(np.bytes_))
442617
def _reorder_columns(bed_file):
    
    new_bed = utils.splitext_plus(bed_file)[0] + '_order.bed'
    with open(bed_file) as in_handle:
        with open(new_bed, 'w') as out_handle:
            for line in in_handle:
                cols = line.strip().split("\t")
                cols[3] = _select_anno(cols[3]) + "_" + cols[4]
                cols[4] = "0"
                print("\t".join(cols), file=out_handle, end="")
    return new_bed
261061
def filter_cols(model, *filtered_columns):
    
    m = sa.orm.class_mapper(model)
    return list(
        {p.key for p in m.iterate_properties if hasattr(p, "columns")}.difference(
            filtered_columns
        )
    )