Find valid column names from a PyCBC HDF5 Group

    Returns a `set` of names.
197605
def _get_columns(h5group):
    
    columns = set()
    for name in sorted(h5group):
        if (not isinstance(h5group[name], h5py.Dataset) or
                name == 'template_boundaries'):
            continue
        if name.endswith('_template') and name[:-9] in columns:
            continue
        columns.add(name)
    return columns - META_COLUMNS
975505
def read_hdf5_dict(h5f, names=None, path=None, on_missing='error', **kwargs):
    
    if path:
        h5f = h5f[path]

    # allow alternative keyword argument name (FIXME)
    if names is None:
        names = kwargs.pop('flags', None)

    # try and get list of names automatically
    if names is None:
        try:
            names = find_flag_groups(h5f, strict=True)
        except KeyError:
            names = None
        if not names:
            raise ValueError("Failed to automatically parse available flag "
                             "names from HDF5, please give a list of names "
                             "to read via the ``names=`` keyword")

    # read data
    out = DataQualityDict()
    for name in names:
        try:
            out[name] = read_hdf5_flag(h5f, name, **kwargs)
        except KeyError as exc:
            if on_missing == 'ignore':
                pass
            elif on_missing == 'warn':
                warnings.warn(str(exc))
            else:
                raise ValueError('no H5Group found for flag '
                                 '{0!r}'.format(name))

    return out
1227267
def get_user_columns_list(self):
        
        ret_lst = list()
        for col_name in self.get_columns_list():
            if (not self.is_pk(col_name)) and (not self.is_fk(col_name)):
                ret_lst.append(col_name)
        return ret_lst
754373
private OrderedHashSet getBaseColumnNames(java.util.List<Expression> indexExprs) {
        OrderedHashSet set = new OrderedHashSet();

        HsqlList col_list = new HsqlArrayList();
        for (Expression expression : indexExprs) {
            expression.collectAllColumnExpressions(col_list);
        }

        for (int i = 0; i < col_list.size(); i++) {
            String colName = ((ExpressionColumn)col_list.get(i)).columnName;
            set.add(colName);
        }

        return set;
    }
1109706
def open_hdf5(filename, mode='r'):
    
    if isinstance(filename, (h5py.Group, h5py.Dataset)):
        return filename
    if isinstance(filename, FILE_LIKE):
        return h5py.File(filename.name, mode)
    return h5py.File(filename, mode)
302710
def get_cols(self, lines):
        
        re_name_def = re.compile(r'^\s*%\s+(?P<colname>\w+)')
        self.names = []
        for line in lines:
            if not line:  # ignore empty lines in header (windows)
                continue
            if not line.startswith('%'):  # end of header lines
                break
            match = re_name_def.search(line)
            if match:
                self.names.append(match.group('colname'))

        if not self.names:
            raise core.InconsistentTableError(
                'No column names found in Omega header')

        self.cols = []  # pylint: disable=attribute-defined-outside-init
        for name in self.names:
            col = core.Column(name=name)
            self.cols.append(col)
621939
def read_hdf5_flag(h5f, path=None, gpstype=LIGOTimeGPS):
    
    # extract correct group
    dataset = _get_flag_group(h5f, path)

    # read dataset
    active = SegmentList.read(dataset['active'], format='hdf5',
                              gpstype=gpstype)
    try:
        known = SegmentList.read(dataset['known'], format='hdf5',
                                 gpstype=gpstype)
    except KeyError as first_keyerror:
        try:
            known = SegmentList.read(dataset['valid'], format='hdf5',
                                     gpstype=gpstype)
        except KeyError:
            raise first_keyerror

    return DataQualityFlag(active=active, known=known, **dict(dataset.attrs))
598890
def identity_attributes(cls):
        
        columns = inspect(cls).primary_key
        names = [c.name for c in columns if c.name not in ('width', 'height')]
        return names
622749
function getColumnType(columnDefinitions, columnName) {
    Validate.isObject(columnDefinitions);
    Validate.notNull(columnDefinitions);
    Validate.isString(columnName);
    Validate.notNullOrEmpty(columnName);

    for (var column in columnDefinitions) {
        if (column.toLowerCase() === columnName.toLowerCase()) {
            return columnDefinitions[column];
        }
    }
}
1320416
def fetch_column_names(self, table: str) -> List[str]:
        """"""
        return self.flavour.fetch_column_names(self, table)
150475
def getTableNames(dbid, lowercaseOrUpperCase = "")
      tableNames = []
      dbid ||= @dbid
      getSchema(dbid)      
      if @chdbids
         chdbidArray = findElementsByAttributeName( @chdbids, "name" )
         chdbidArray.each{ |chdbid|
            if chdbid.has_text?
               dbid = chdbid.text
               getSchema( dbid )
               name = getResponseElement( "table/name" )
               if name and name.has_text?
                  if lowercaseOrUpperCase == "lowercase"
                     tableNames << name.text.downcase
                  elsif lowercaseOrUpperCase == "uppercase"
                     tableNames << name.text.upcase
                  else
                     tableNames << name.text.dup
                  end
               end
            end
         }
      end
      tableNames
    end
98622
def __parseColumns(self):
        """"""
        columns = []
        if self.__dataItem.has_key('columnModel'):
            for column in self.__dataItem['columnModel']:
                columns.append(Column(column))
        return columns
1120964
def read_hdf5_dict(h5f, names=None, group=None, **kwargs):
    
    # find group from which to read
    if group:
        h5g = h5f[group]
    else:
        h5g = h5f

    # find list of names to read
    if names is None:
        names = [key for key in h5g if _is_timeseries_dataset(h5g[key])]

    # read names
    out = kwargs.pop('dict_type', TimeSeriesDict)()
    kwargs.setdefault('array_type', out.EntryClass)
    for name in names:
        out[name] = read_hdf5_timeseries(h5g[name], **kwargs)

    return out
213855
def _ids_and_column_names(names, force_lower_case=False):
        """"""
        fixed = OrderedDict()
        for name in names:
            identifier = RowWrapper._make_identifier(name)
            if force_lower_case:
                identifier = identifier.lower()
            while identifier in fixed:
                identifier = RowWrapper._increment_numeric_suffix(identifier)
            fixed[identifier] = name
        return fixed
278051
function findAllColumnNames(rows) {
  const columnNames = []

  for (let i = 0; i < rows.length; i++) {
    for (let key in rows[i]) {
      if (columnNames.includes(key)) {
        continue
      }

      columnNames.push(key)
    }
  }

  return columnNames
}
697221
def identify_pycbc_live(origin, filepath, fileobj, *args, **kwargs):
    
    if identify_hdf5(origin, filepath, fileobj, *args, **kwargs) and (
            filepath is not None and PYCBC_FILENAME.match(basename(filepath))):
        return True
    return False
1231417
def getFieldNames( dbid = nil, lowerOrUppercase = "", exclude_built_in_fields = false )
      fieldNames = []
      dbid ||= @dbid
      getSchema(dbid)
      if @fields
         @fields.each_element_with_attribute( "id" ){ |f|
            next if exclude_built_in_fields and isBuiltInField?(f.attributes["id"])
            if f.name == "field"
               if lowerOrUppercase == "lowercase"
                  fieldNames << f.elements[ "label" ].text.downcase
               elsif lowerOrUppercase == "uppercase"
                  fieldNames << f.elements[ "label" ].text.upcase
               else
                  fieldNames << f.elements[ "label" ].text.dup
               end
            end
         }
      end
      fieldNames
    end