Seed the Plans table.
963778
public function run()
    {
        $defaults = [];

        $defaults = $this->cleanupAndMerge($this->getDefaults(), $this->config);

        foreach ($defaults as $slug => $column) {
            $setting = Setting::bySlug($slug);

            if ($setting->count()) {
                $setting->first()->update([
                    'default' => $column,
                ]);
            } else {
                Setting::create([
                    'lang'    => null,
                    'slug'    => $slug,
                    'value'   => $column,
                    'default' => $column,
                ]);
            }
        }
    }
222320
public static Builder newBuilder(TableId table, RowToInsert... rows) {
    return newBuilder(table, ImmutableList.copyOf(rows));
  }
502619
public function run(): void
    {
        foreach ($this->seed as $key => $value) {
            $this->call($this->each, $value, $key);
        }
    }
123809
function fill(size, seed, multiplier) {
    var hash = new HashTable(size, seed, multiplier);
    var x = agentdb.getX(1, 1); // dummy data Unknown, Unknown
    agents.forEach(function (agent) {
        if (agent.status < 2) {
            var obj = { "a": agent.agent, "x": x };
            hash.add('a', obj);
        }
    });
    return hash.getHistory();
}
97478
def set_seed(seed: int):
    
    random.seed(seed)
    np.random.seed(seed)
    torch.random.manual_seed(seed)
659694
def run(self):
        
        if not (self.table):
            raise Exception("table need to be specified")

        path = self.s3_load_path()
        output = self.output()
        connection = output.connect()
        cursor = connection.cursor()

        self.init_copy(connection)
        self.copy(cursor, path)
        self.post_copy(cursor)

        if self.enable_metadata_columns:
            self.post_copy_metacolumns(cursor)

        # update marker table
        output.touch(connection)
        connection.commit()

        # commit and clean up
        connection.close()
1311461
function(doit, checkit, seed) {
      var ret = [];
      var result = doit(seed);

      while (checkit(result)) {
        ret.push(result);
        result = doit(result);
      }

      return ret;
    }
1177997
private void buildSlots(ObjectStreamField[] fields) {
        slotsToSerialize = new ObjectSlot[fields.length];
        for (int i = 0; i < fields.length; i++) {
            ObjectSlot s = new ObjectSlot();
            slotsToSerialize[i] = s;
            s.field = fields[i];
        }
        // We assume the slots are already sorted in the right shape for dumping
    }
464575
void advance()
        {
            // we are always at the leaf level when this method is invoked
            // so we calculate the seed for generating the row by combining the seed that generated the clustering components
            int depth = clusteringComponents.length - 1;
            long parentSeed = clusteringSeeds[depth];
            long rowSeed = seed(clusteringComponents[depth].peek(), generator.clusteringComponents.get(depth).type, parentSeed);

            // and then fill the row with the _non-clustering_ values for the position we _were_ at, as this is what we'll deliver
            for (int i = clusteringSeeds.length ; i < row.row.length ; i++)
            {
                Generator gen = generator.valueComponents.get(i - clusteringSeeds.length);
                gen.setSeed(rowSeed);
                row.row[i] = gen.generate();
            }

            // then we advance the leaf level
            setHasNext(advance(depth, false));
        }
638560
private void growTable()
   {
		if (tc.isEntryEnabled()) SibTr.entry(this, tc, "growTable");      
      int newSize = Math.min(table.length+TABLE_GROWTH_INCREMENT, maxSize);
      if (tc.isDebugEnabled()) SibTr.debug(this, tc, "existing size="+table.length+" new size="+newSize);
      Object[] newTable = new Object[newSize+1];
      System.arraycopy(table, 0, newTable, 0, table.length);
      table = newTable;
		if (tc.isEntryEnabled()) SibTr.exit(this, tc, "growTable");
   }
902492
def generate_random_table(self):
        
        table = list(range(0, self.n))
        random.shuffle(table)
        return table
441427
function buildTableColumns(item, tableStructuresAndCombinations) {
  if (!defined(tableStructuresAndCombinations)) {
    // Invalid selection, eg. missing a selected code for a concept.
    return []; // Remove current columns.
  }
  var tableStructures = tableStructuresAndCombinations.tableStructures;
  var activeCombinations = tableStructuresAndCombinations.activeCombinations;
  if (tableStructures.length <= 1) {
    throwLoadError(item, "GetGenericData");
  }
  // The last element of the tableStructures is the total population.
  var totalPopulationTableStructure = tableStructures.pop();

  var firstTableStructure = tableStructures[0];
  var timeColumn = firstTableStructure.columns[0];
  var regionColumn = firstTableStructure.columns[2];
  var isTimeVarying =
    defined(timeColumn) && timeColumn.minimumValue !== timeColumn.maximumValue;
  // If there is time variation, for now, let's turn off the displayPercent option.
  // (since we don't have time-varying population data yet)
  if (isTimeVarying) {
    item.canDisplayPercent = false;
    item.displayPercent = false;
  } else {
    item.canDisplayPercent = true; // Assume we can unless proven otherwise.
  }

  var newColumns = buildValueColumns(item, tableStructures, activeCombinations);
  var totalSelectedColumn = new TableColumn(
    "Total selected",
    TableColumn.sumValues(newColumns),
    {
      active: !item.displayPercent
    }
  );
  // If there's more than one combination selected, add the total selected.
  if (newColumns.length > 1) {
    newColumns.push(totalSelectedColumn);
  } else if (!item.displayPercent) {
    // If there's only one value column, activate it.
    newColumns[0].isActive = true;
  }

  // Only add the total population columns if there is no time variation
  // (for now, since we don't have time-varying population data)
  if (!isTimeVarying) {
    var totalPopColumns = totalPopulationTableStructure.columns;
    // Check that the regions correspond in the two tables.  Assume total popn table has regions as first column.
    if (
      !arraysAreEqual(
        totalPopColumns[0].values.slice(0, regionColumn.values.length),
        regionColumn.values
      )
    ) {
      console.error(
        "Region ordering is different between total population data file and ABS data set."
      );
      // Activate the last value column, turn off percentDisplay and don't add the total population columns.
      item.canDisplayPercent = false;
      item.displayPercent = false;
      newColumns[newColumns.length - 1].isActive = true;
    } else {
      var totalPopColumn = new TableColumn(
        "Total population",
        totalPopColumns[totalPopColumns.length - 1].values.slice(
          0,
          regionColumn.values.length
        )
      );
      newColumns.push(totalPopColumn);
      var percentValues = TableColumn.divideValues(
        totalSelectedColumn,
        totalPopColumn,
        0
      ).map(function(fraction) {
        return fraction < 0.01
          ? Math.round(fraction * 1000) / 10
          : Math.round(fraction * 10000) / 100;
      });
      newColumns.push(
        new TableColumn("Total selected percent", percentValues, {
          active: item.displayPercent
        })
      );
    }
  }
  // Rename the region column to conform to csv-geo-au.
  // Since only one regiontype code can be selected, all combinations have the same regiontype.
  // (Don't use getActiveRegionTypeCode() because the UI might no longer reflect which regiontype was loaded.)
  // Just use the first time from the time column; we assume these are all the same (eg. 2011).
  var loadedRegionCode = activeCombinations[0].filter(function(absCode) {
    return absCode.concept.id === item.regionTypeConcept;
  })[0];
  var regionColumnName = regionTypeToCsvGeo(loadedRegionCode.code, timeColumn);

  // Make sure the Time and REGION columns match across columns (apart from the totalPopulationTableStructure).
  // Don't worry about Description - it is a description of the region, which we get from the region mapping anyway.
  if (!isTimeVarying) {
    timeColumn.options.type = VarType.SCALAR; // Otherwise we can get a spurious clock.
  }
  timeColumn = new TableColumn("Year", timeColumn.values, timeColumn.options);
  regionColumn = new TableColumn(
    regionColumnName,
    regionColumn.values,
    regionColumn.options
  );
  tableStructures.slice(1).forEach(function(tableStructure) {
    if (
      !arraysAreEqual(tableStructure.columns[0], timeColumn) ||
      !arraysAreEqual(tableStructure.columns[2], regionColumn)
    ) {
      throwDataMergeError(item);
    }
  });

  // Put these columns to the front of the value columns.
  newColumns.unshift(timeColumn);
  newColumns.unshift(regionColumn);

  return newColumns;
}
232677
def gen_uposix(table, posix_table):
    """"""

    # `Alnum: [\p{L&}\p{Nd}]`
    s = set(table['l']['c'] + table['n']['d'])
    posix_table["posixalnum"] = list(s)

    # `Alpha: [\p{L&}]`
    s = set(table['l']['c'])
    posix_table["posixalpha"] = list(s)

    # `ASCII: [\x00-\x7F]`
    s = set([x for x in range(0, 0x7F + 1)])
    posix_table["posixascii"] = list(s)

    # `Blank: [\p{Zs}\t]`
    s = set(table['z']['s'] + [0x09])
    posix_table["posixblank"] = list(s)

    # `Cntrl: [\p{Cc}]`
    s = set(table['c']['c'])
    posix_table["posixcntrl"] = list(s)

    # `Digit: [\p{Nd}]`
    s = set(table['n']['d'])
    posix_table["posixdigit"] = list(s)

    # `Graph: [^\p{Z}\p{C}]`
    s = set()
    for table_name in ('z', 'c'):
        for sub_table_name in table[table_name]:
            if not sub_table_name.startswith('^'):
                s |= set(table[table_name][sub_table_name])
    posix_table["^posixgraph"] = list(s)

    # `Lower: [\p{Ll}]`
    s = set(table['l']['l'])
    posix_table["posixlower"] = list(s)

    # `Print: [\P{C}]`
    s = set()
    for table_name in ('c',):
        for sub_table_name in table[table_name]:
            if not sub_table_name.startswith('^'):
                s |= set(table[table_name][sub_table_name])
    posix_table["^posixprint"] = list(s)

    # `Punct: [\p{P}\p{S}]`
    s = set()
    for table_name in ('p', 's'):
        for sub_table_name in table[table_name]:
            if not sub_table_name.startswith('^'):
                s |= set(table[table_name][sub_table_name])
    posix_table["posixpunct"] = list(s)

    # `Space: [\p{Z}\t\r\n\v\f]`
    s = set()
    for table_name in ('z',):
        for sub_table_name in table[table_name]:
            if not sub_table_name.startswith('^'):
                s |= set(table[table_name][sub_table_name])
    s |= set([x for x in range(0x09, 0x0e)])
    posix_table["posixspace"] = list(s)

    # `Upper: [\p{Lu}]`
    s = set(table['l']['u'])
    posix_table["posixupper"] = list(s)

    # `XDigit: [A-Fa-f0-9]`
    s = set([x for x in range(0x30, 0x39 + 1)])
    s |= set([x for x in range(0x41, 0x46 + 1)])
    s |= set([x for x in range(0x61, 0x66 + 1)])
    posix_table["posixxdigit"] = list(s)
1073213
public void setupSFields()
    {
        Record record = this.getMainRecord();
        this.addColumn(new MultipleTableFieldConverter(record, CalendarEntry.START_DATE_TIME));
        this.addColumn(new MultipleTableFieldConverter(record, CalendarEntry.END_DATE_TIME));
        this.addColumn(new MultipleTableFieldConverter(record, CalendarEntry.DESCRIPTION));
    }
499070
def _seed(self):
        """"""
        for name in self.__slots__:
            value = getattr(self, name, UNSET)
            if value is UNSET:
                setattr(self, name, self.__class__._default)
324567
def _SetTable(self, table):
    """"""
    if not isinstance(table, TextTable):
      raise TypeError('Not an instance of TextTable.')
    self.Reset()
    self._table = copy.deepcopy(table._table)   # pylint: disable=W0212
    # Point parent table of each row back ourselves.
    for row in self:
      row.table = self
881158
protected function seedSchedules()
    {
        $defaultSchedules = [
            [
                'name'         => 'Demo resets every half hour!',
                'message'      => 'You can schedule downtime for _your_ service!',
                'status'       => Schedule::UPCOMING,
                'scheduled_at' => (new DateTime())->add(new DateInterval('PT2H')),
            ],
        ];

        Schedule::truncate();

        foreach ($defaultSchedules as $schedule) {
            Schedule::create($schedule);
        }
    }