Create an empty source table.

    Returns
    -------
    tab : `~astropy.table.Table`
543255
def create_source_table(scan_shape):
    

    cols_dict = collections.OrderedDict()
    cols_dict['Source_Name'] = dict(dtype='S48', format='%s')
    cols_dict['name'] = dict(dtype='S48', format='%s')
    cols_dict['class'] = dict(dtype='S32', format='%s')
    cols_dict['SpectrumType'] = dict(dtype='S32', format='%s')
    cols_dict['SpatialType'] = dict(dtype='S32', format='%s')
    cols_dict['SourceType'] = dict(dtype='S32', format='%s')
    cols_dict['SpatialModel'] = dict(dtype='S32', format='%s')
    cols_dict['RAJ2000'] = dict(dtype='f8', format='%.3f', unit='deg')
    cols_dict['DEJ2000'] = dict(dtype='f8', format='%.3f', unit='deg')
    cols_dict['GLON'] = dict(dtype='f8', format='%.3f', unit='deg')
    cols_dict['GLAT'] = dict(dtype='f8', format='%.3f', unit='deg')
    cols_dict['ts'] = dict(dtype='f8', format='%.3f')
    cols_dict['loglike'] = dict(dtype='f8', format='%.3f')
    cols_dict['npred'] = dict(dtype='f8', format='%.3f')
    cols_dict['offset'] = dict(dtype='f8', format='%.3f', unit='deg')
    cols_dict['offset_ra'] = dict(dtype='f8', format='%.3f', unit='deg')
    cols_dict['offset_dec'] = dict(dtype='f8', format='%.3f', unit='deg')
    cols_dict['offset_glon'] = dict(dtype='f8', format='%.3f', unit='deg')
    cols_dict['offset_glat'] = dict(dtype='f8', format='%.3f', unit='deg')
    cols_dict['offset_roi_edge'] = dict(dtype='f8', format='%.3f', unit='deg')
    cols_dict['pivot_energy'] = dict(dtype='f8', format='%.3f', unit='MeV')
    cols_dict['flux_scan'] = dict(dtype='f8', format='%.3f',
                                  shape=scan_shape)
    cols_dict['eflux_scan'] = dict(dtype='f8', format='%.3f',
                                   shape=scan_shape)
    cols_dict['norm_scan'] = dict(dtype='f8', format='%.3f',
                                  shape=scan_shape)
    cols_dict['dloglike_scan'] = dict(dtype='f8', format='%.3f',
                                      shape=scan_shape)
    cols_dict['loglike_scan'] = dict(dtype='f8', format='%.3f',
                                     shape=scan_shape)

    # Add source dictionary columns
    for k, v in sorted(defaults.source_output.items()):
        if not k in cols_dict.keys():
            if v[2] == float:
                cols_dict[k] = dict(dtype='f8', format='%f')
            elif k == 'Spectrum_Filename' or k == 'Spatial_Filename':
                cols_dict[k] = dict(dtype='S128', format='%s')
            elif v[2] == str:
                cols_dict[k] = dict(dtype='S32', format='%s')

    cols_dict['param_names'] = dict(dtype='S32', format='%s', shape=(10,))
    cols_dict['param_values'] = dict(dtype='f8', format='%f', shape=(10,))
    cols_dict['param_errors'] = dict(dtype='f8', format='%f', shape=(10,))

    # Catalog Parameters
    cols_dict['Flux_Density'] = dict(
        dtype='f8', format='%.5g', unit='1 / (MeV cm2 s)')
    cols_dict['Spectral_Index'] = dict(dtype='f8', format='%.3f')
    cols_dict['Pivot_Energy'] = dict(dtype='f8', format='%.3f', unit='MeV')
    cols_dict['beta'] = dict(dtype='f8', format='%.3f')
    cols_dict['Exp_Index'] = dict(dtype='f8', format='%.3f')
    cols_dict['Cutoff'] = dict(dtype='f8', format='%.3f', unit='MeV')
    cols_dict['Expfactor'] = dict(dtype='f8', format='%.3f')

    cols_dict['Conf_68_PosAng'] = dict(dtype='f8', format='%.3f', unit='deg')
    cols_dict['Conf_68_SemiMajor'] = dict(
        dtype='f8', format='%.3f', unit='deg')
    cols_dict['Conf_68_SemiMinor'] = dict(
        dtype='f8', format='%.3f', unit='deg')
    cols_dict['Conf_95_PosAng'] = dict(dtype='f8', format='%.3f', unit='deg')
    cols_dict['Conf_95_SemiMajor'] = dict(
        dtype='f8', format='%.3f', unit='deg')
    cols_dict['Conf_95_SemiMinor'] = dict(
        dtype='f8', format='%.3f', unit='deg')

    for t in ['eflux', 'eflux100', 'eflux1000', 'eflux10000']:
        cols_dict[t] = dict(dtype='f8', format='%.3f', unit='MeV / (cm2 s)')
        cols_dict[t + '_err'] = dict(dtype='f8',
                                     format='%.3f', unit='MeV / (cm2 s)')

    for t in ['eflux_ul95', 'eflux100_ul95', 'eflux1000_ul95', 'eflux10000_ul95']:
        cols_dict[t] = dict(dtype='f8', format='%.3f', unit='MeV / (cm2 s)')

    for t in ['flux', 'flux100', 'flux1000', 'flux10000']:
        cols_dict[t] = dict(dtype='f8', format='%.3f', unit='1 / (cm2 s)')
        cols_dict[t + '_err'] = dict(dtype='f8',
                                     format='%.3f', unit='1 / (cm2 s)')

    for t in ['flux_ul95', 'flux100_ul95', 'flux1000_ul95', 'flux10000_ul95']:
        cols_dict[t] = dict(dtype='f8', format='%.3f', unit='1 / (cm2 s)')

    for t in ['dnde', 'dnde100', 'dnde1000', 'dnde10000']:
        cols_dict[t] = dict(dtype='f8', format='%.3f', unit='1 / (MeV cm2 s)')
        cols_dict[t + '_err'] = dict(dtype='f8',
                                     format='%.3f', unit='1 / (MeV cm2 s)')

    cols = [Column(name=k, **v) for k, v in cols_dict.items()]
    tab = Table(cols)
    return tab
1217031
def create_table(table_name, options = {})
      table_definition = TableDefinition.new
      table_definition.define_primary_keys(options[:primary_keys]) if options[:primary_keys]
      table_definition.define_partition_keys(options[:partition_keys]) if options[:partition_keys]
      table_definition.define_options(options[:options]) if options[:options]

      yield table_definition if block_given?

      announce_operation "create_table(#{table_name})"

      create_cql =  "CREATE TABLE #{table_name} ("
      create_cql << table_definition.to_create_cql
      create_cql << ")"
      create_cql << table_definition.options

      announce_suboperation create_cql

      execute create_cql
    end
684996
private Table gettableWithCreateTime(Table table, int createTime) {
    if (table.isSetCreateTime() && table.getCreateTime() > 0) {
      return table;
    }
    Table actualtable = table.deepCopy();
    actualtable.setCreateTime(createTime);
    return actualtable;
  }
1332652
async def create_table(**data):
    

    table = data.get('table')

    try:
        clickhouse_queries.create_table(table, data)
        return 'Table was successfully created'

    except ServerException as e:
        exception_code = int(str(e)[5:8].strip())

        if exception_code == 57:
            return 'Table already exists'
        elif exception_code == 50:
            return 'Invalid params'
1031009
def make_table(self):
        """"""
        num_records = int(np.sum([1 for frame in self.timeseries]))
        dtype = [("frame",float),("time",float),("ligand atom id",int),
                ("ligand atom name","|U4"),("distance",float),
                ("resid",int),("resname","|U4"),("segid","|U8") ]
        out = np.empty((num_records,),dtype=dtype)
        cursor=0
        for contact in self.timeseries:
            out[cursor] = (contact.frame, contact.time,contact.ligandatomid,contact.ligandatomname,contact.distance,
                           contact.resid,contact.resname,contact.segid)
            cursor+=1
        return out.view(np.recarray)
1108259
def from_(self, table, alias=None):
        
        if isinstance(table, str):
            table = [[table, alias]]
        self.raw_tables = table
        return self
871184
def create_or_open_table_at index
      t = self[index]
      t = self[index] = Workbook::Table.new if t == nil
      t.sheet = self
      t
    end
846393
def make_delete_table(table: Table, delete_prefix='delete_from__') -> Table:
    """"""

    name = delete_prefix + table.name
    primary_key = table.primary_key
    key_names = set(primary_key.column_names)
    columns = [column for column in table.columns if column.name in key_names]
    table = Table(name, columns, primary_key)

    return table
1259987
def create_sc_table(scfile, colnames=None):
    """"""

    if utils.is_fits_file(scfile) and colnames is None:
        return create_table_from_fits(scfile, 'SC_DATA')

    if utils.is_fits_file(scfile):
        files = [scfile]
    else:
        files = [line.strip() for line in open(scfile, 'r')]

    tables = [create_table_from_fits(f, 'SC_DATA', colnames)
              for f in files]

    return vstack(tables)
424601
def _create_table():
    '''
    
    '''
    # Explicitely check if the table already exists as the library logs a
    # warning on CREATE TABLE
    query = """SELECT COUNT(TABLE_NAME) FROM information_schema.tables
        WHERE table_schema = '{0}' AND table_name = '{1}'""".format(
            _mysql_kwargs['db'],
            _table_name,
        )
    cur, _ = run_query(client, query)
    r = cur.fetchone()
    cur.close()
    if r[0] == 1:
        return

    query = """CREATE TABLE IF NOT EXISTS {0} (
      bank CHAR(255),
      etcd_key CHAR(255),
      data MEDIUMBLOB,
      PRIMARY KEY(bank, etcd_key)
    );""".format(_table_name)
    log.info("mysql_cache: creating table %s", _table_name)
    cur, _ = run_query(client, query)
    cur.close()
337803
def _initialise(self):
        
        d = {'score': 0, 'pointer': None, 'ins': 0, 'del': 0}
        cols = len(self.seq1Seq) + 1
        rows = len(self.seq2Seq) + 1
        # Note that this puts a ref to the same dict (d) into each cell of
        # the table. Hopefully that is what was intended. Eyeballing the
        # code below that uses the table it looks like table entries are
        # entirely replaced, so this seems ok. Terry.
        table = [[d for _ in range(cols)] for _ in range(rows)]
        return table
800343
function (table) {
			var isArr = shine.lib.table.getn (table) > 0,
				result = shine.gc['create' + (isArr? 'Array' : 'Object')](),
				numValues = table.__shine.numValues,
				i,
				l = numValues.length;

			for (i = 1; i < l; i++) {
				result[i - 1] = ((numValues[i] || shine.EMPTY_OBJ) instanceof shine.Table)? shine.utils.toObject(numValues[i]) : numValues[i];
			}

			for (i in table) {
				if (table.hasOwnProperty(i) && !(i in shine.Table.prototype) && i !== '__shine') {
					result[i] = ((table[i] || shine.EMPTY_OBJ) instanceof shine.Table)? shine.utils.toObject(table[i]) : table[i];
				}
			}
			
			return result;
		}
763662
def _init_table(self):
        
        self.observation_table.sm_vector.append(self.epsilon)
        self.observation_table.smi_vector = list(self.alphabet)
        self.observation_table.em_vector.append(self.epsilon)

        self._fill_table_entry(self.epsilon, self.epsilon)
        for s in self.observation_table.smi_vector:
            self._fill_table_entry(s, self.epsilon)
50656
def create(self, type_, *args, **kwargs) -> Any:
        
        attribute = type_(self, *args, **kwargs)
        self._table.append(attribute)
        return attribute
327626
def to_table_data(self):
        

        self._validate_source_data()
        self._loader.inc_table_count()

        yield TableData(
            self._make_table_name(),
            ["key", "value"],
            [record for record in self._buffer.items()],
            dp_extractor=self._loader.dp_extractor,
            type_hints=self._extract_type_hints(),
        )
762025
def take_table(tbl, indices, axis=None, out=None, mode='raise', blen=None, storage=None,
               create='table', **kwargs):
    """"""

    # setup
    if axis is not None and axis != 0:
        raise NotImplementedError('only axis 0 is supported')
    if out is not None:
        # argument is only there for numpy API compatibility
        raise NotImplementedError('out argument is not supported')
    if mode is not None and mode != 'raise':
        raise NotImplementedError('only mode=raise is supported')
    names, columns = _util.check_table_like(tbl)
    length = len(columns[0])

    # check that indices are strictly increasing
    indices = np.asanyarray(indices)
    if np.any(indices[1:] <= indices[:-1]):
        raise NotImplementedError(
            'indices must be strictly increasing'
        )

    # implement via compress()
    condition = np.zeros((length,), dtype=bool)
    condition[indices] = True
    return compress_table(condition, tbl, blen=blen, storage=storage,
                          create=create, **kwargs)
1118149
def create_table(clas,pool_or_cursor):
    ""
    def mkfield((name,tp)): return name,(tp if isinstance(tp,basestring) else 'jsonb')
    fields = ','.join(map(' '.join,map(mkfield,clas.FIELDS)))
    base = 'create table if not exists %s (%s'%(clas.TABLE,fields)
    if clas.PKEY: base += ',primary key (%s)'%clas.PKEY
    base += ')'
    commit_or_execute(pool_or_cursor,base)
    clas.create_indexes(pool_or_cursor)