Returns a column name for aggregated data based on the given source column name and function
773784
public static String aggregateColumnName(String columnName, String functionName) {
        return String.format("%s [%s]", functionName, columnName);
    }
32779
def _get_unique_function_name(function_type, functions):
    '''
    '''
    function_name = function_name_base = function_type
    count = 2
    while function_name in functions:
        function_name = '{}_{}'.format(function_name_base, count)
        count += 1
    return function_name
292309
def get_column_metadata(conn, table: str, schema='public'):
    """"""
    query = """\
SELECT
  attname as name,
  format_type(atttypid, atttypmod) AS data_type,
  NOT attnotnull AS nullable
FROM pg_catalog.pg_attribute
WHERE attrelid=%s::regclass
  AND attnum > 0 AND NOT attisdropped
ORDER BY attnum;"""

    qualified_name = compile_qualified_name(table, schema=schema)

    for record in select_dict(conn, query, params=(qualified_name,)):
        yield record
767638
def ColumnAttr(name='', attr=None, **kwargs):
    ''
    return Column(name,
                  expr=attr if attr is not None else name,
                  getter=lambda col,row: getattrdeep(row, col.expr),
                  setter=lambda col,row,val: setattrdeep(row, col.expr, val),
                  **kwargs)
1006643
def _columns_for_table(table_name):
    
    return {cname: col
            for (tname, cname), col in _COLUMNS.items()
            if tname == table_name}
823779
def getColumnsByName(elem, name):
	
	name = StripColumnName(name)
	return elem.getElements(lambda e: (e.tagName == ligolw.Column.tagName) and (e.Name == name))
1327873
public ColumnFunctionBuilder getColumn(final String columnName) {
    Preconditions.checkNotNull(columnName);

    return new ColumnFunctionBuilder() {
      @SuppressWarnings("unchecked")
      @Override
      public <T> Function<Cursor, T> as(Class<T> klass) {
        Preconditions.checkArgument(mTypeAdapters.containsKey(klass));

        final TypeAdapter<T> adapter = (TypeAdapter<T>) mTypeAdapters.get(klass);

        return new Function<Cursor, T>() {
          @Override
          public T apply(Cursor c) {
            return adapter.fromCursor(c, columnName);
          }
        };
      }
    };
  }
43463
def column_names(self, table):
      """"""

      table_info = self.execute(
        u'PRAGMA table_info(%s)' % quote(table))
      return (column['name'] for column in table_info)
929838
def get_db_name(self, fname):
        """"""
        return self.funcs.db_func(fname, self.outdir, self.exes.format_exe)[1]
1090400
def col(self, col_name_or_num):
        
        if isinstance(col_name_or_num, basestring):
            return self[col_name_or_num]
        elif isinstance(col_name_or_num, (int, long)):
            if col_name_or_num > len(self.fields):
                raise IndexError("Invalid column index `%s` for DataTable" %
                                 col_name_or_num)
            return self.__data[self.fields[col_name_or_num]]
217543
def add_column(self, func, name=None, show=True):
        """"""
        assert func
        name = name or func.__name__
        if name == '<lambda>':
            raise ValueError("Please provide a valid name for " + name)
        d = {'func': func,
             'show': show,
             }
        self._columns[name] = d

        # Update the headers in the widget.
        data = _create_json_dict(cols=self.column_names,
                                 )
        self.eval_js('table.setHeaders({});'.format(data))

        return func
1051850
def _get_str_columns(sf):
    
    return [name for name in sf.column_names() if sf[name].dtype == str]
1101042
function _columns() {
    var distinct = false;
    if (this.onlyUnions()) {
      return '';
    }
    var columns = this.grouped.columns || [];
    var i = -1,
        sql = [];
    if (columns) {
      while (++i < columns.length) {
        var stmt = columns[i];
        if (stmt.distinct) {
          distinct = true;
        }
        if (stmt.type === 'aggregate') {
          sql.push(this.aggregate(stmt));
        } else if (stmt.value && stmt.value.length > 0) {
          sql.push(this.formatter.columnize(stmt.value));
        }
      }
    }
    if (sql.length === 0) {
      sql = ['*'];
    }
    return 'select ' + (distinct ? 'distinct ' : '') + sql.join(', ') + (this.tableName ? ' from ' + this.tableName : '');
  }
1127498
def compile_column(name: str, data_type: str, nullable: bool) -> str:
    """"""

    null_str = 'NULL' if nullable else 'NOT NULL'

    return '{name} {data_type} {null},'.format(name=name,
                                               data_type=data_type,
                                               null=null_str)
1291926
def __rm_names_on_csv_cols(d):
        
        _names = []
        _data = []
        for name, data in d.items():
            _names.append(name)
            _data.append(data)
        return _names, _data
629428
def get_column_names(engine: Engine, tablename: str) -> List[str]:
    
    return [info.name for info in gen_columns_info(engine, tablename)]
375964
def get_timestamps(cols, created_name, updated_name):
  """"""
  has_created = created_name in cols
  has_updated = updated_name in cols
  return (created_name if has_created else None, updated_name if has_updated else None)