This function generates the CRC table used for the table_driven CRC
        algorithm.  The Python version cannot handle tables of an index width
        other than 8.  See the generated C code for tables with different sizes
        instead.
502165
def gen_table(self):
        
        table_length = 1 << self.TableIdxWidth
        tbl = [0] * table_length
        for i in range(table_length):
            register = i
            if self.ReflectIn:
                register = self.reflect(register, self.TableIdxWidth)
            register = register << (self.Width - self.TableIdxWidth + self.CrcShift)
            for j in range(self.TableIdxWidth):
                if register & (self.MSB_Mask << self.CrcShift) != 0:
                    register = (register << 1) ^ (self.Poly << self.CrcShift)
                else:
                    register = (register << 1)
            if self.ReflectIn:
                register = self.reflect(register >> self.CrcShift, self.Width) << self.CrcShift
            tbl[i] = register & (self.Mask << self.CrcShift)
        return tbl
26039
function crc32( buffer, seed, table ) {

  var crc = seed ^ -1
  var length = buffer.length - 15
  var TABLE = table || crc32.TABLE.DEFAULT
  var i = 0

  while( i < length ) {
    crc = ( crc >>> 8 ) ^ TABLE[ 0xFF & ( crc ^ buffer[ i++ ] ) ]
    crc = ( crc >>> 8 ) ^ TABLE[ 0xFF & ( crc ^ buffer[ i++ ] ) ]
    crc = ( crc >>> 8 ) ^ TABLE[ 0xFF & ( crc ^ buffer[ i++ ] ) ]
    crc = ( crc >>> 8 ) ^ TABLE[ 0xFF & ( crc ^ buffer[ i++ ] ) ]
    crc = ( crc >>> 8 ) ^ TABLE[ 0xFF & ( crc ^ buffer[ i++ ] ) ]
    crc = ( crc >>> 8 ) ^ TABLE[ 0xFF & ( crc ^ buffer[ i++ ] ) ]
    crc = ( crc >>> 8 ) ^ TABLE[ 0xFF & ( crc ^ buffer[ i++ ] ) ]
    crc = ( crc >>> 8 ) ^ TABLE[ 0xFF & ( crc ^ buffer[ i++ ] ) ]
    crc = ( crc >>> 8 ) ^ TABLE[ 0xFF & ( crc ^ buffer[ i++ ] ) ]
    crc = ( crc >>> 8 ) ^ TABLE[ 0xFF & ( crc ^ buffer[ i++ ] ) ]
    crc = ( crc >>> 8 ) ^ TABLE[ 0xFF & ( crc ^ buffer[ i++ ] ) ]
    crc = ( crc >>> 8 ) ^ TABLE[ 0xFF & ( crc ^ buffer[ i++ ] ) ]
    crc = ( crc >>> 8 ) ^ TABLE[ 0xFF & ( crc ^ buffer[ i++ ] ) ]
    crc = ( crc >>> 8 ) ^ TABLE[ 0xFF & ( crc ^ buffer[ i++ ] ) ]
    crc = ( crc >>> 8 ) ^ TABLE[ 0xFF & ( crc ^ buffer[ i++ ] ) ]
    crc = ( crc >>> 8 ) ^ TABLE[ 0xFF & ( crc ^ buffer[ i++ ] ) ]
  }

  length = length + 15

  while( i < length )
    crc = ( crc >>> 8 ) ^ TABLE[ ( crc ^ buffer[ i++ ] ) & 0xFF ]

  return crc ^ -1

}
596977
function crcTable(arr, append) {
		var crc, i, l;

		// if we're in append mode, don't reset crc
		// if arr is null or undefined, reset table and return
		if (typeof crcTable.crc === 'undefined' || !append || !arr) {
			crcTable.crc = 0 ^ -1;

			if (!arr) {
				return;
			}
		}

		// store in temp variable for minor speed gain
		crc = crcTable.crc;

		for (i = 0, l = arr.length; i < l; i += 1) {
			crc = (crc >>> 8) ^ table[(crc ^ arr[i]) & 0xff];
		}

		crcTable.crc = crc;

		return crc ^ -1;
	}
1204490
def build_ebound_table(self):
        
        cols = [
            Column(name="E_MIN", dtype=float, data=self._emin, unit='MeV'),
            Column(name="E_MAX", dtype=float, data=self._emax, unit='MeV'),
            Column(name="E_REF", dtype=float, data=self._eref, unit='MeV'),
            Column(name="REF_DNDE", dtype=float, data=self._ref_dnde,
                   unit='ph / (MeV cm2 s)'),
            Column(name="REF_FLUX", dtype=float, data=self._ref_flux,
                   unit='ph / (cm2 s)'),
            Column(name="REF_EFLUX", dtype=float, data=self._ref_eflux,
                   unit='MeV / (cm2 s)'),
            Column(name="REF_NPRED", dtype=float, data=self._ref_npred,
                   unit='ph')
        ]
        tab = Table(data=cols)
        return tab
1047827
def source_table(self):
        
        table = Table()
        table['GLON'] = np.array([0, 45, 45], dtype='float32')
        table['GLAT'] = np.array([0, 0, 45], dtype='float32')
        table['COUNTS'] = np.array([100, 100, 100], dtype='int32')
        return table
576470
def table_type(table_name):
    
    table = get_raw_table(table_name)

    if isinstance(table, DataFrameWrapper):
        return 'dataframe'
    elif isinstance(table, TableFuncWrapper):
        return 'function'
130388
def table(self, table):
        
        try:
            blueprint = self._create_blueprint(table)

            yield blueprint
        except Exception as e:
            raise

        try:
            self._build(blueprint)
        except Exception:
            raise
1261139
def generate_acyclic_graph(self):
        

        # Maximum length of each table, respectively.
        # Hardcoded n = cm, where c = 3
        # There might be a good way to choose an appropriate C,
        # but [1] suggests the average amount of iterations needed
        # to generate an acyclic graph is sqrt(3).
        self.n = 3 * len(self.words)

        max_tries = len(self.words) ** 2
        for trial in range(max_tries):
            try:
                self.generate_or_fail()
            except forest.InvariantError:
                continue
            else:
                # Generated successfully!
                self.trials_taken = trial + 1
                return

        raise RuntimeError("Could not generate graph in "
                           "{} tries".format(max_tries))
995408
protected Table generateTable(int tableIndex) {

        Table t = sysTables[tableIndex];

//        Please note that this class produces non-null tables for
//        just those absolutely essential to the JDBC 1 spec and the
//        HSQLDB core.  Also, all table producing methods except
//        SYSTEM_PROCEDURES() and SYSTEM_PROCEDURECOLUMNS() are declared final;
//        this class produces only an empty table for each, as per previous
//        DatabaseInformation implementations, whereas
//        DatabaseInformationFull produces comprehensive content for
//        them).
//
//        This break down of inheritance allows DatabaseInformation and
//        DatabaseInformationMain (this class) to be made as small as possible
//        while still meeting their mandates:
//
//        1.) DatabaseInformation prevents use of reserved system table names
//            for user tables and views, meaning that even under highly
//            constrained use cases where the notion of DatabaseMetaData can
//            be discarded (i.e. the engine operates in a distribution where
//            DatabaseInforationMain/Full and JDBCDatabaseMetaData have been
//            dropped from the JAR), it is still impossible to produce a
//            database which will be incompatible in terms of system table <=>
//            user table name clashes, if/when imported into a more
//            capable operating environment.
//
//        2.) DatabaseInformationMain builds on DatabaseInformation, providing
//            at minimum what is needed for comprehensive operation under
//            JDK 1.1/JDBC 1 and provides, at minimum, what was provided under
//            earlier implementations.
//
//        3.) descendents of DatabaseInformationMain (such as the current
//            DatabaseInformationFull) need not (and indeed: now cannot)
//            override most of the DatabaseInformationMain table producing
//            methods, as for the most part they are expected to be already
//            fully comprehensive, security aware and accessible to all users.
        switch (tableIndex) {

            case SYSTEM_ALLTYPEINFO :
                return SYSTEM_ALLTYPEINFO();

            case SYSTEM_BESTROWIDENTIFIER :
                return SYSTEM_BESTROWIDENTIFIER();

            case SYSTEM_COLUMNS :
                return SYSTEM_COLUMNS();

            case SYSTEM_CROSSREFERENCE :
                return SYSTEM_CROSSREFERENCE();

            case SYSTEM_INDEXINFO :
                return SYSTEM_INDEXINFO();

            case SYSTEM_PRIMARYKEYS :
                return SYSTEM_PRIMARYKEYS();

            case SYSTEM_PROCEDURECOLUMNS :
                return SYSTEM_PROCEDURECOLUMNS();

            case SYSTEM_PROCEDURES :
                return SYSTEM_PROCEDURES();

            case SYSTEM_SCHEMAS :
                return SYSTEM_SCHEMAS();

            case SYSTEM_TABLES :
                return SYSTEM_TABLES();

            case SYSTEM_TABLETYPES :
                return SYSTEM_TABLETYPES();

            case SYSTEM_TYPEINFO :
                return SYSTEM_TYPEINFO();

            case SYSTEM_USERS :
                return SYSTEM_USERS();

            case SYSTEM_SEQUENCES :
                return SYSTEM_SEQUENCES();

            case COLUMN_PRIVILEGES :
                return COLUMN_PRIVILEGES();

            case SEQUENCES :
                return SEQUENCES();

            case TABLE_PRIVILEGES :
                return TABLE_PRIVILEGES();

            case INFORMATION_SCHEMA_CATALOG_NAME :
                return INFORMATION_SCHEMA_CATALOG_NAME();

            default :
                return null;
        }
    }
1167365
def gen_table(contents):
    
    xlengths = []
    ylengths = []
    for column in contents:
        col_len = 0
        for entry in column:
            lines = entry.split('\n')
            for line in lines:
                col_len = max(len(line) + 2, col_len)
        xlengths.append(col_len)
    for i in range(len(contents[0])):
        ymax = 0
        for j in range(len(contents)):
            ymax = max(ymax, len(contents[j][i].split('\n')))
        ylengths.append(ymax)

    table_divider = '+' + ''.join(['-' * i + '+' for i in xlengths]) + '\n'
    table = table_divider
    for i in range(len(ylengths)):
        row = [column[i] for column in contents]
        row = [entry + '\n' * (ylengths[i]-len(entry.split('\n'))) for entry in row]
        row = [entry.split('\n') for entry in row]
        for j in range(ylengths[i]):
            k = 0
            for entry in row:
                width = xlengths[k]
                table += ''.join(['| {:{}}'.format(entry[j], width - 1)])
                k += 1
            table += '|\n'
        table += table_divider
    return table + '\n'
1023322
def lcs_table(x, y)
      # This method does not take a block as an explicit parameter for performance reasons.
      c = Array.new(x.size) {[]}
      x.size.times {|i| c[i][0] = 0}
      y.size.times {|j| c[0][j] = 0}
      (1...x.size).each do |i|
        (1...y.size).each do |j|
          c[i][j] =
            if yield x[i], y[j]
              c[i - 1][j - 1] + 1
            else
              [c[i][j - 1], c[i - 1][j]].max
            end
        end
      end
      c
    end
385862
def create_table(cls):
        
        schema_editor = getattr(connection, 'schema_editor', None)
        if schema_editor:
            with schema_editor() as schema_editor:
                schema_editor.create_model(cls)
        else:
            raw_sql, _ = connection.creation.sql_create_model(
                cls,
                no_style(),
                [])
            cls.delete_table()
            cursor = connection.cursor()
            try:
                cursor.execute(*raw_sql)
            finally:
                cursor.close()
819251
def gen_table_key(self, table, db='default'):
        
        table = force_text(table)
        db = force_text(settings.DB_CACHE_KEYS[db])
        if len(table) > 100:
            table = table[0:68] + self.gen_key(table[68:])
        if db and len(db) > 100:
            db = db[0:68] + self.gen_key(db[68:])
        return '%s_%s_table_%s' % (self.prefix, db, table)
1335080
static final int crc8(final byte[] input, final int offset, final int len) {
		final int poly = 0x0D5;
		int crc = 0;
		for (int i = 0; i < len; i++) {
			final byte c = input[offset + i];
			crc ^= c;
			for (int j = 0; j < 8; j++) {
				if ((crc & 0x80) != 0) {
					crc = ((crc << 1) ^ poly);
				} else {
					crc <<= 1;
				}
			}
			crc &= 0xFF;
		}
		return crc;
	}
388676
def gen_xlsx_table():
    '''
    
    '''


    XLSX_FILE = './database/esheet/20180811.xlsx'
    if os.path.exists(XLSX_FILE):
        pass
    else:
        return

    fields = []
    for sheet_ranges in load_workbook(filename=XLSX_FILE):

        for xr in FILTER_COLUMNS:
            row1_val = sheet_ranges[xr + "1"].value
            row2_val = sheet_ranges[xr + "2"].value
            row3_val = sheet_ranges[xr + "3"].value
            row4_val = sheet_ranges[xr + "4"].value
            if row1_val and row1_val.strip() != '':
                desc = {
                    'slug': row1_val,
                    'name': row2_val,
                    'type': row3_val,
                    'display_mode': row4_val
                }

                fields.append(desc)

    create_tab(fields)
656453
def generate_table_rows
        table_rows = []

        if @args[:columns] && @args[:columns].length > 0
          # manage case with custom columns
          table_rows = generate_table_rows_from_columns_functions(@args[:columns])
        elsif @records && @records.length > 0
          # manage case without custom columns
          table_rows = generate_table_rows_from_columns_functions(@records.first.attributes.keys)
        end

        return table_rows
      end
583239
public static byte calc(byte[] data, int len) {
        byte crc = 0;

        for (int i = 0; i < len; i++)
            crc = CRC8_TABLE[(crc ^ data[i]) & 0xff];

        return crc;
    }