Auto generated seed file.
760078
public function run()
    {
        $post = $this->findPost('lorem-ipsum-post');
        if (!$post->exists) {
            $post->fill([
                'title'            => 'Lorem Ipsum Post',
                'author_id'        => 0,
                'seo_title'        => null,
                'excerpt'          => 'This is the excerpt for the Lorem Ipsum Post',
                'body'             => '<p>This is the body of the lorem ipsum post</p>',
                'image'            => 'posts/nlje9NZQ7bTMYOUG4lF1.jpg',
                'slug'             => 'lorem-ipsum-post',
                'meta_description' => 'This is the meta description',
                'meta_keywords'    => 'keyword1, keyword2, keyword3',
                'status'           => 'PUBLISHED',
                'featured'         => 0,
            ])->save();
        }

        $post = $this->findPost('my-sample-post');
        if (!$post->exists) {
            $post->fill([
                'title'     => 'My Sample Post',
                'author_id' => 0,
                'seo_title' => null,
                'excerpt'   => 'This is the excerpt for the sample Post',
                'body'      => '<p>This is the body for the sample post, which includes the body.</p>
                <h2>We can use all kinds of format!</h2>
                <p>And include a bunch of other stuff.</p>',
                'image'            => 'posts/7uelXHi85YOfZKsoS6Tq.jpg',
                'slug'             => 'my-sample-post',
                'meta_description' => 'Meta Description for sample post',
                'meta_keywords'    => 'keyword1, keyword2, keyword3',
                'status'           => 'PUBLISHED',
                'featured'         => 0,
            ])->save();
        }

        $post = $this->findPost('latest-post');
        if (!$post->exists) {
            $post->fill([
                'title'            => 'Latest Post',
                'author_id'        => 0,
                'seo_title'        => null,
                'excerpt'          => 'This is the excerpt for the latest post',
                'body'             => '<p>This is the body for the latest post</p>',
                'image'            => 'posts/9txUSY6wb7LTBSbDPrD9.jpg',
                'slug'             => 'latest-post',
                'meta_description' => 'This is the meta description',
                'meta_keywords'    => 'keyword1, keyword2, keyword3',
                'status'           => 'PUBLISHED',
                'featured'         => 0,
            ])->save();
        }

        $post = $this->findPost('yarr-post');
        if (!$post->exists) {
            $post->fill([
                'title'     => 'Yarr Post',
                'author_id' => 0,
                'seo_title' => null,
                'excerpt'   => 'Reef sails nipperkin bring a spring upon her cable coffer jury mast spike marooned Pieces of Eight poop deck pillage. Clipper driver coxswain galleon hempen halter come about pressgang gangplank boatswain swing the lead. Nipperkin yard skysail swab lanyard Blimey bilge water ho quarter Buccaneer.',
                'body'      => '<p>Swab deadlights Buccaneer fire ship square-rigged dance the hempen jig weigh anchor cackle fruit grog furl. Crack Jennys tea cup chase guns pressgang hearties spirits hogshead Gold Road six pounders fathom measured fer yer chains. Main sheet provost come about trysail barkadeer crimp scuttle mizzenmast brig plunder.</p>
<p>Mizzen league keelhaul galleon tender cog chase Barbary Coast doubloon crack Jennys tea cup. Blow the man down lugsail fire ship pinnace cackle fruit line warp Admiral of the Black strike colors doubloon. Tackle Jack Ketch come about crimp rum draft scuppers run a shot across the bow haul wind maroon.</p>
<p>Interloper heave down list driver pressgang holystone scuppers tackle scallywag bilged on her anchor. Jack Tar interloper draught grapple mizzenmast hulk knave cable transom hogshead. Gaff pillage to go on account grog aft chase guns piracy yardarm knave clap of thunder.</p>',
                'image'            => 'posts/yuk1fBwmKKZdY2qR1ZKM.jpg',
                'slug'             => 'yarr-post',
                'meta_description' => 'this be a meta descript',
                'meta_keywords'    => 'keyword1, keyword2, keyword3',
                'status'           => 'PUBLISHED',
                'featured'         => 0,
            ])->save();
        }
    }
634313
public byte[] generateSeed(int length) throws SeedException
    {
        FileInputStream file = null;
        try
        {
            file = new FileInputStream(DEV_RANDOM);
            byte[] randomSeed = new byte[length];
            int count = 0;
            while (count < length)
            {
                int bytesRead = file.read(randomSeed, count, length - count);
                if (bytesRead == -1)
                {
                    throw new SeedException("EOF encountered reading random data.");
                }
                count += bytesRead;
            }
            return randomSeed;
        }
        catch (IOException ex)
        {
            throw new SeedException("Failed reading from " + DEV_RANDOM.getName(), ex);
        }
        catch (SecurityException ex)
        {
            // Might be thrown if resource access is restricted (such as in
            // an applet sandbox).
            throw new SeedException("SecurityManager prevented access to " + DEV_RANDOM.getName(), ex);
        }
        finally
        {
            if (file != null)
            {
                try
                {
                    file.close();
                }
                catch (IOException ex)
                {
                    // Ignore.
                }
            }
        }
    }
1145235
def seed_rngs(seed: int) -> None:
    
    np.random.seed(seed)
    random.seed(seed)
    mx.random.seed(seed)
181218
def setRandomSeed(self, seed):
    
    self.seed = seed
    self._random = Random()
    self._random.setSeed(seed)
517442
protected function bootSeeds()
    {
        if (isset($this->dir) and isset($this->seedDirs) and is_array($this->seedDirs)) {
            foreach ($this->seedDirs as $dirPath) {
                $this->publishes([ $this->getDatabasePath($dirPath) => database_path($this->seedsDestinationPath) ], 'seeds');
            }
        }
    }
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;
        }
    }
604143
def generate_config_file():
    
    shutil.copy(os.path.join(os.path.dirname(__file__), 'input_parameters.yaml'),
                os.path.join(os.getcwd(), 'ProTECT_config.yaml'))
812530
def load_seed
      seed_file = paths["db/seeds.rb"].existent.first
      return unless seed_file

      if config.try(:active_job)&.queue_adapter == :async
        with_inline_jobs { load(seed_file) }
      else
        load(seed_file)
      end
    end
174836
def run(input_file, options):
    """"""

    options.logger = log
    generator.Generator(input_file, **options.__dict__).execute()
883531
def generate(self, step, params):
        """"""
        # Recurse into a DictFactory: allows users to have some params depending
        # on others.
        params = step.recurse(base.DictFactory, params, force_sequence=step.sequence)
        filename, content = self._make_content(params)
        return django_files.File(content.file, filename)
1057984
public static function generate()
    {
        if (class_exists('O2System\Filesystem\System')) {
            $system = new \O2System\Filesystem\System();

            $metadata = [
                'machine'         => $system->getMachine(),
                'operatingSystem' => [
                    'name'    => $system->getName(),
                    'version' => $system->getVersion(),
                    'release' => $system->getRelease(),
                ],
                'hostname'        => $system->getHostname(),
                'cpuCores'        => $system->getCpuCores(),
                'macAddress'      => $system->getMacAddress(),
            ];
        } else {
            $metadata = [
                'machine'         => php_uname('m'),
                'operatingSystem' => [
                    'name'    => php_uname('s'),
                    'version' => php_uname('v'),
                    'release' => php_uname('r'),
                ],
                'hostname'        => php_uname('n'),
                'cpuCores'        => 1,
                'macAddress'      => implode(':', str_split(substr(md5('none'), 0, 12), 2)),
            ];
        }

        $uri = new Uri();

        $metadata[ 'domain' ] = $uri->getHost();
        $metadata[ 'ipAddress' ] = $_SERVER[ 'SERVER_ADDR' ];

        $string = json_encode($metadata);
        $string = md5($string);

        // Converts to UUID (Universally Unique Identifier)
        $parts[] = substr($string, 0, 8);
        $parts[] = substr($string, 8, 4);
        $parts[] = substr($string, 12, 4);
        $parts[] = substr($string, 16, 4);
        $parts[] = substr($string, 20, 12);

        $parts = array_map('strtoupper', $parts);

        return implode('-', $parts);
    }
787304
def gen_files(path, prefix="_"):
    "  "

    if op.isdir(path):
        for name in listdir(path):
            fpath = op.join(path, name)
            if is_parsed_file(fpath):
                yield op.abspath(fpath)

    elif is_parsed_file(path):
        yield op.abspath(path)
283991
public static void seed(long seed) {
        System.out.println("SEED="+seed);
        Prng.seed = seed;
        curRandom.setSeed(seed);
    }
922961
def generate(env):
    """"""
    c_file, cxx_file = SCons.Tool.createCFileBuilders(env)

    # C
    c_file.add_action('.y', YaccAction)
    c_file.add_emitter('.y', yEmitter)

    c_file.add_action('.yacc', YaccAction)
    c_file.add_emitter('.yacc', yEmitter)

    # Objective-C
    c_file.add_action('.ym', YaccAction)
    c_file.add_emitter('.ym', ymEmitter)

    # C++
    cxx_file.add_action('.yy', YaccAction)
    cxx_file.add_emitter('.yy', yyEmitter)

    env['YACC']      = env.Detect('bison') or 'yacc'
    env['YACCFLAGS'] = SCons.Util.CLVar('')
    env['YACCCOM']   = '$YACC $YACCFLAGS -o $TARGET $SOURCES'
    env['YACCHFILESUFFIX'] = '.h'

    env['YACCHXXFILESUFFIX'] = '.hpp'

    env['YACCVCGFILESUFFIX'] = '.vcg'
930700
def GenerateFile(self, input_filename=None, output_filename=None):
    """"""
    if input_filename is None:
      input_filename = output_filename + ".in"
    if output_filename[-3:] == ".in":
      output_filename = output_filename[:-3]
    logging.debug("Generating file %s from %s", output_filename, input_filename)

    with io.open(input_filename, "r") as fd:
      data = fd.read()

    with io.open(output_filename, "w") as fd:
      fd.write(config.CONFIG.InterpolateValue(data, context=self.context))
561564
def generate_default_schema(output):
    """"""
    original_path = os.path.join(os.path.dirname(__file__),
                                 'data',
                                 'randomnames-schema.json')
    shutil.copyfile(original_path, output)
251653
protected function generate()
	{
		if ( $this->fields ) {
			parent::fire();

			if ( $this->log ) {
				$file = $this->datePrefix . '_' . $this->migrationName;
				$this->repository->log($file, $this->batch);
			}
		}
	}