to have been generated and their seeds populated into clusteringSeeds
769193
void fill(int depth)
        {
            long seed = clusteringSeeds[depth - 1];
            Generator gen = generator.clusteringComponents.get(depth);
            gen.setSeed(seed);
            clusteringSeeds[depth] = seed(clusteringComponents[depth - 1].peek(), generator.clusteringComponents.get(depth - 1).type, seed);
            fill(clusteringComponents[depth], (int) gen.clusteringDistribution.next(), gen);
        }
890078
protected Cluster[] calculateInitialClusters(List<? extends Clusterable> values, int numClusters){
        Cluster[] clusters = new Cluster[numClusters];
        //choose centers and create the initial clusters
        Random random = new Random(1);
        Set<Integer> clusterCenters = new HashSet<Integer>();
        for ( int i = 0; i < numClusters; i++ ){
            int index = random.nextInt(values.size());
            while ( clusterCenters.contains(index) ){
                index = random.nextInt(values.size());
            }
            clusterCenters.add(index);
            clusters[i] = new Cluster(values.get(index).getLocation(),i);
        }
        return clusters;
    }
669480
private function createSeedsTable(AbstractSchemaManager $manager): void
    {
        $table = new Table($this->getSeedsTable());

        $table
            ->addColumn(static::SEEDS_COLUMN_ID, Type::INTEGER)
            ->setUnsigned(true)
            ->setAutoincrement(true);
        $table
            ->addColumn(static::SEEDS_COLUMN_CLASS, Type::STRING)
            ->setLength(255);
        $table
            ->addColumn(static::SEEDS_COLUMN_SEEDED_AT, Type::DATETIME);

        $table->setPrimaryKey([static::SEEDS_COLUMN_ID]);
        $table->addUniqueIndex([static::SEEDS_COLUMN_CLASS]);

        $manager->createTable($table);
    }
160001
private function createSeeder(): void
    {
        $aFields  = $this->getArguments();
        $aCreated = [];

        try {

            $aModels = array_filter(explode(',', $aFields['MODEL_NAME']));
            sort($aModels);

            foreach ($aModels as $sModel) {

                $aFields['MODEL_NAME'] = $sModel;
                $this->oOutput->write('Creating seeder <comment>' . $sModel . '</comment>... ');

                //  Validate model exists by attempting to load it
                if (!stringToBoolean($this->oInput->getOption('skip-check'))) {
                    Factory::model($sModel, $aFields['MODEL_PROVIDER']);
                }

                //  Check for existing seeder
                $sPath = static::SEEDER_PATH . $sModel . '.php';
                if (file_exists($sPath)) {
                    throw new SeederExistsException(
                        'Seeder "' . $sModel . '" exists already at path "' . $sPath . '"'
                    );
                }

                $this->createFile($sPath, $this->getResource('template/seeder.php', $aFields));
                $aCreated[] = $sPath;
                $this->oOutput->writeln('<info>done!</info>');
            }

        } catch (\Exception $e) {
            $this->oOutput->writeln('<error>failed!</error>');
            //  Clean up created seeders
            if (!empty($aCreated)) {
                $this->oOutput->writeln('<error>Cleaning up - removing newly created files</error>');
                foreach ($aCreated as $sPath) {
                    @unlink($sPath);
                }
            }
            throw $e;
        }
    }
810236
function (seed_x, seed_y, radius, layers_no) {
        // Layer 0 is the seed
        var layers = [[create_point(seed_x, seed_y)]];
        var layer, angle, point, p;
        for(layer = 0; layer < layers_no; layer++) {
            // Reserve space for next layer
            layers.push([]);
            for (point = 0; point < layers[layer].length; point++) {
                for (angle = 0; angle < angles.length; angle++) {
                    p = rotate_point(create_point(
                            layers[layer][point].x,
                            layers[layer][point].y - radius),
                            layers[layer][point], 
                            angles[angle]);

                    if (!point_exists(p, flatten(layers))) {
                        // Only new points continue generations
                        layers[layer + 1].push(p);
                    }
                }
            }
        }

        // Layers have been generated, return getters
        return {
            layers: function () {
                return layers;
            },

            points: function () {
                return flatten(layers);
            }
        }

    }
97478
def set_seed(seed: int):
    
    random.seed(seed)
    np.random.seed(seed)
    torch.random.manual_seed(seed)
1062590
int createUserIndexForClusters() {
		if (m_clusterIndices == null) {
			m_clusterIndices = new ArrayList<AttributeStreamOfInt32>(3);
		}

		AttributeStreamOfInt32 new_stream = new AttributeStreamOfInt32(
				m_clusterData.capacity(), -1);
		for (int i = 0, n = m_clusterIndices.size(); i < n; i++) {
			if (m_clusterIndices.get(i) == null) {
				m_clusterIndices.set(i, new_stream);
				return i;
			}
		}
		m_clusterIndices.add(new_stream);
		return m_clusterIndices.size() - 1;
	}
972379
public function seed(array $seeds)
    {
        foreach ($seeds as $seed) {
            /** @var  \Arcanesoft\Auth\Models\PermissionsGroup  $group */
            $group       = PermissionsGroup::create($seed['group']);
            $permissions = array_map(function ($permission) {
                return new Permission($permission);
            }, $seed['permissions']);

            $group->permissions()->saveMany($permissions);
        }
    }
10896
def initialize(self, grid=None, num_of_paths=None, seed=None):
        
        self.num_of_paths = num_of_paths
        self.grid = grid
        self.seed = seed
        self.result = list()
        self.state = self.initial_state
554718
@Override
	public Clustering getClusteringResult() {
		List<double[]> microClustering;
		// If the buffer phase is active then the buffer (without duplicates) is
		// equal to the micro clustering
		if (this.bufferPhase) {
			microClustering = new ArrayList<double[]>(this.buffer.size());
			for (double[] pointA : this.buffer) {
				// Searches for a duplicate of the current point
				boolean duplicate = false;
				for (double[] pointB : microClustering) {
					int i;
					for (i = 0; i < pointA.length; i++) {
						if (pointA[i] != pointB[i + 1]) {
							break;
						}
					}
					if (i == pointA.length) {
						duplicate = true;
						pointB[0] += 1;
						break;
					}
				}

				if (!duplicate) {
					// Copies the point to an array with the weight in the first
					// element
					double[] pointWeighted = new double[pointA.length + 1];
					pointWeighted[0] = 1;
					System.arraycopy(pointA, 0, pointWeighted, 1, pointA.length);
					microClustering.add(pointWeighted);
				}
			}
		} else {
			// Collects all nodes as arrays with the weight in the first element
			microClustering = this.root
					.addToClusteringCenters(new ArrayList<double[]>(this.rootCount));
		}
		// Runs the k-means algorithm five times on the micro clustering
		List<double[]> result = null;
		double minValue = Double.POSITIVE_INFINITY;
		for (int i = 0; i < 5; i++) {
			// Creates the starting centroids
			List<double[]> newResult = CoresetKMeans
					.generatekMeansPlusPlusCentroids(this.numClusters,
							microClustering, this.clustererRandom);
			// Runs the k-means algorithm with changing the starting centroids
			double newValue = CoresetKMeans.kMeans(newResult, microClustering);
			// Selects the result with minimum costs
			if (newValue < minValue) {
				result = newResult;
				minValue = newValue;
			}
		}

		// Prepares the points for the clustering result
		AutoExpandVector<Cluster> resultClustering = new AutoExpandVector<Cluster>(
				result.size());
		for (double[] point : result) {
			resultClustering.add(new SphereCluster(point, 0.0));
		}
		return new Clustering(resultClustering);
	}
404940
public boolean generateAndSort(final Iterator<long[]> iterator, final long seed) {
		// We cache all variables for faster access
		final int[] d = this.d;
		final int[] e = new int[3];
		cleanUpIfNecessary();

		/* We build the XOR'd edge list and compute the degree of each vertex. */
		for(int k = 0; k < numEdges; k++) {
			tripleToEdge(iterator.next(), seed, numVertices, partSize, e);
			xorEdge(k, e[0], e[1], e[2], false);
			d[e[0]]++;
			d[e[1]]++;
			d[e[2]]++;
		}

		if (iterator.hasNext()) throw new IllegalStateException("This " + HypergraphSorter.class.getSimpleName() + " has " + numEdges + " edges, but the provided iterator returns more");

		return sort();
	}
975839
def initialise_clusters(self, input_, clustercount):
        
        # initialise the clusters with empty lists
        self.__clusters = []
        for _ in range(clustercount):
            self.__clusters.append([])

        # distribute the items into the clusters
        count = 0
        for item in input_:
            self.__clusters[count % clustercount].append(item)
            count += 1
379961
@Override
    public void setSeed(long seed) {
        if (initialized) {
            throw new UnsupportedOperationException();
        }
        initialized = true;
        rnd = (seed ^ multiplier) & mask;
    }
556014
private void processNeighbors(DoubleDBIDListIter neighbor, ModifiableDBIDs currentCluster, ArrayModifiableDBIDs seeds) {
    final boolean ismetric = getDistanceFunction().isMetric();
    for(; neighbor.valid(); neighbor.advance()) {
      if(processedIDs.add(neighbor)) {
        if(!ismetric || neighbor.doubleValue() > 0.) {
          seeds.add(neighbor);
        }
      }
      else if(!noise.remove(neighbor)) {
        continue;
      }
      currentCluster.add(neighbor);
    }
  }
233246
def generate_poisson_lineage(n_states, n_cells_per_cluster, n_genes, means=300):
    
    # means...
    M = np.random.random((n_genes, n_states))*means
    center = M.mean(1)
    W = np.zeros((n_states, n_cells_per_cluster*n_states))
    # TODO
    # start at a center where all the clusters have equal probability, and for
    # each cluster, interpolate linearly towards the cluster.
    index = 0
    means = np.array([1.0/n_states]*n_states)
    for c in range(n_states):
        for i in range(n_cells_per_cluster):
            w = np.copy(means)
            new_value = w[c] + i*(1.0 - 1.0/n_states)/n_cells_per_cluster
            w[:] = (1.0 - new_value)/(n_states - 1.0)
            w[c] = new_value
            W[:, index] = w
            index += 1
    return M, W
677910
def serialize_seeds(seeds, block):
    
    for seed_dict in block.seeds:
        seed = etree.SubElement(seeds, 'seed')
        # options in xml starts with 1
        seed.set('option', unicode(seed_dict.get('answer', 0) + 1))
        seed.text = seed_dict.get('rationale', '')
350629
public void setWebSeeds(List<WebSeedEntry> seeds) {
        web_seed_entry_vector v = new web_seed_entry_vector();

        for (WebSeedEntry e : seeds) {
            v.push_back(e.swig());
        }

        ti.set_web_seeds(v);
    }