Seed initial fields
499070
def _seed(self):
        """"""
        for name in self.__slots__:
            value = getattr(self, name, UNSET)
            if value is UNSET:
                setattr(self, name, self.__class__._default)
1179993
function autoseed(seed) {
  try {
    global.crypto.getRandomValues(seed = new Uint8Array(width));
    return tostring(seed);
  } catch (e) {
    return [+new Date, global, global.navigator.plugins,
            global.screen, tostring(pool)];
  }
}
868198
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, NAME, 50, null, null);
        field = new FieldInfo(this, PARENT_FOLDER_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, SEQUENCE, 5, null, null);
        field.setDataClass(Short.class);
        field = new FieldInfo(this, COMMENT, 255, null, null);
        field = new FieldInfo(this, CODE, 30, null, null);
        field = new FieldInfo(this, TYPE, 50, null, null);
        field = new FieldInfo(this, FIELD_VALUE, 255, null, null);
        field = new FieldInfo(this, RETURNS_VALUE, 50, null, null);
        field = new FieldInfo(this, MAXIMUM, 10, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, SYSTEM_NAME, 30, null, null);
        field = new FieldInfo(this, COMMENTS, 10, null, null);
        field.setDataClass(Boolean.class);
    }
1092085
public void initialize(CmsUpdateBean updateBean) throws Exception {

        if (updateBean.isInitialized()) {
            CmsParameterConfiguration props = updateBean.getProperties();

            // Initialize the CmsUUID generator.
            CmsUUID.init(props.get("server.ethernet.address"));

            m_dbName = props.get("db.name");

            List<String> pools = CmsStringUtil.splitAsList(props.get("db.pools"), ',');
            for (String pool : pools) {
                Map<String, String> data = new HashMap<String, String>();
                data.put("driver", props.get("db.pool." + pool + ".jdbcDriver"));
                data.put("url", props.get("db.pool." + pool + ".jdbcUrl"));
                data.put("params", props.get("db.pool." + pool + ".jdbcUrl.params"));
                data.put("user", props.get("db.pool." + pool + ".user"));
                data.put("pwd", props.get("db.pool." + pool + ".password"));
                data.put("keepHistory", String.valueOf(updateBean.isKeepHistory()));
                m_dbPools.put(pool, data);
            }
        } else {
            throw new Exception("setup bean not initialized");
        }
    }
121559
def _auto_init(self, *args, **kwrds):
    """"""
    for fld in getattr(self, '__fields__', []):
        val = kwrds.get(fld.name, _NO_VAL)
        if val is _NO_VAL:
            val = fld.get_default_val()
        setattr(self, fld.name, val)

    if callable(getattr(self, 'setup', None)):
        self.setup(*args, **kwrds)
326991
def do_init_fields(self, flist):
        
        for f in flist:
            self.default_fields[f.name] = copy.deepcopy(f.default)
            self.fieldtype[f.name] = f
            if f.holds_packets:
                self.packetfields.append(f)
317889
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, CLASS_NAME, 40, null, null);
        field = new FieldInfo(this, SEQUENCE_NO, 4, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, KEY_NAME, 40, null, null);
        field = new FieldInfo(this, VALUE_NAME, 255, null, null);
    }
157604
public void init(BaseField field, GridScreenParent gridScreen, Record recGrid, boolean bCreateSortOrder)
    {
        m_recGrid = recGrid;
        m_bCreateSortOrder = bCreateSortOrder;
        super.init(field, gridScreen, null);
        m_iKeyAreaArray = new String[MAX_ARRAY_SIZE];
        for (int i = 0; i < MAX_ARRAY_SIZE; i++)
            m_iKeyAreaArray[i] = null;
        m_iNextArrayIndex = 0;
    }
1309901
def seed(self):
        

        for generation in self.generations:
            for s in generation:
                try:
                    if s.rseed is not None:
                        value = s.random(**s.parents.value)
                except:
                    pass
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;
        }
    }
192431
public void init(BaseField field, ScreenComponent screenField, BaseField fldTarget)
    {
        super.init(field);
        m_screenField = screenField;
        m_fldTarget = fldTarget;

        m_bScreenMove = true;   // Only respond to user change
        m_bInitMove = false;
        m_bReadMove = false;
        if (screenField == null)
            this.lookupSField();
    }
825711
private static void seedData(PersistenceManager manager) throws OnyxException
    {
        Account account = new Account();
        //noinspection SpellCheckingInspection
        account.setAccountName("Timbob's Lawn Care");
        account.setBalanceDue(55.43f);

        Invoice marchLawnInvoice = new Invoice();
        marchLawnInvoice.setDueDate(parseDate("04-01-2016"));
        marchLawnInvoice.setInvoiceDate(parseDate("03-01-2016"));
        marchLawnInvoice.setNotes("Why did we need to mow your lawn.  Its basically a dirt field.");
        marchLawnInvoice.setInvoiceId(1L);
        marchLawnInvoice.setAmount(44.32);
        marchLawnInvoice.setAccount(account);

        Invoice aprilLawnInvoice = new Invoice();
        aprilLawnInvoice.setDueDate(parseDate("04-01-2016"));
        aprilLawnInvoice.setInvoiceDate(parseDate("03-01-2016"));
        aprilLawnInvoice.setNotes("Its April, your lawn should be growing by now.");
        aprilLawnInvoice.setInvoiceId(2L);
        aprilLawnInvoice.setAmount(44.32);
        aprilLawnInvoice.setAccount(account);

        manager.saveEntity(account);
        manager.saveEntity(marchLawnInvoice);
        manager.saveEntity(aprilLawnInvoice);

        Payment marchLawnCarePayment = new Payment();
        marchLawnCarePayment.setPaymentId(1L);
        marchLawnCarePayment.setInvoice(marchLawnInvoice);
        marchLawnCarePayment.setAmount(44.32);

        manager.saveEntity(marchLawnCarePayment);

        Account account1 = manager.findById(Account.class, 1);
        assert account1 != null;
        assert account1.getAccountId() == 1L;
    }
103441
private void initializeFields() {
		final IPath path = this.workingCopy.getJarFile();
		String tooltip = null;
		String basename = null;
		if (path != null) {
			tooltip = path.toOSString();
			final IPath tmpPath = path.removeTrailingSeparator();
			if (tmpPath != null) {
				basename = tmpPath.lastSegment();
			}
		}
		this.sreLibraryTextField.setText(Strings.nullToEmpty(basename));
		this.sreLibraryTextField.setToolTipText(Strings.nullToEmpty(tooltip));
		//
		final String name = this.workingCopy.getNameNoDefault();
		this.sreNameTextField.setText(Strings.nullToEmpty(name));
		//
		final String mainClass = this.workingCopy.getMainClass();
		this.sreMainClassTextField.setText(Strings.nullToEmpty(mainClass));
		//
		this.sreIdTextField.setText(this.workingCopy.getId());
	}
1325416
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, SEQUENCE, 10, null, new Integer(1000));
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, METHOD_NAME, 40, null, null);
        field = new FieldInfo(this, LOGIC_DESCRIPTION, 32000, null, null);
        field = new FieldInfo(this, METHOD_RETURNS, 255, null, null);
        field = new FieldInfo(this, METHOD_INTERFACE, 255, null, null);
        field = new FieldInfo(this, METHOD_CLASS_NAME, 40, null, null);
        field = new FieldInfo(this, LOGIC_SOURCE, 32000, null, null);
        field = new FieldInfo(this, LOGIC_THROWS, 255, null, null);
        field = new FieldInfo(this, PROTECTION, 60, null, null);
        field = new FieldInfo(this, COPY_FROM, 40, null, null);
        field = new FieldInfo(this, INCLUDE_SCOPE, 10, null, new Integer(0x004));
        field.setDataClass(Integer.class);
    }
671188
def _process_input_seed(seed_photon_fields):
        

        Tcmb = 2.72548 * u.K  # 0.00057 K
        Tfir = 30 * u.K
        ufir = 0.5 * u.eV / u.cm ** 3
        Tnir = 3000 * u.K
        unir = 1.0 * u.eV / u.cm ** 3

        # Allow for seed_photon_fields definitions of the type 'CMB-NIR-FIR' or
        # 'CMB'
        if type(seed_photon_fields) != list:
            seed_photon_fields = seed_photon_fields.split("-")

        result = OrderedDict()

        for idx, inseed in enumerate(seed_photon_fields):
            seed = {}
            if isinstance(inseed, six.string_types):
                name = inseed
                seed["type"] = "thermal"
                if inseed == "CMB":
                    seed["T"] = Tcmb
                    seed["u"] = ar * Tcmb ** 4
                    seed["isotropic"] = True
                elif inseed == "FIR":
                    seed["T"] = Tfir
                    seed["u"] = ufir
                    seed["isotropic"] = True
                elif inseed == "NIR":
                    seed["T"] = Tnir
                    seed["u"] = unir
                    seed["isotropic"] = True
                else:
                    log.warning(
                        "Will not use seed {0} because it is not "
                        "CMB, FIR or NIR".format(inseed)
                    )
                    raise TypeError
            elif type(inseed) == list and (
                len(inseed) == 3 or len(inseed) == 4
            ):
                isotropic = len(inseed) == 3

                if isotropic:
                    name, T, uu = inseed
                    seed["isotropic"] = True
                else:
                    name, T, uu, theta = inseed
                    seed["isotropic"] = False
                    seed["theta"] = validate_scalar(
                        "{0}-theta".format(name), theta, physical_type="angle"
                    )

                thermal = T.unit.physical_type == "temperature"

                if thermal:
                    seed["type"] = "thermal"
                    validate_scalar(
                        "{0}-T".format(name),
                        T,
                        domain="positive",
                        physical_type="temperature",
                    )
                    seed["T"] = T
                    if uu == 0:
                        seed["u"] = ar * T ** 4
                    else:
                        # pressure has same physical type as energy density
                        validate_scalar(
                            "{0}-u".format(name),
                            uu,
                            domain="positive",
                            physical_type="pressure",
                        )
                        seed["u"] = uu
                else:
                    seed["type"] = "array"
                    # Ensure everything is in arrays
                    T = u.Quantity((T,)).flatten()
                    uu = u.Quantity((uu,)).flatten()

                    seed["energy"] = validate_array(
                        "{0}-energy".format(name),
                        T,
                        domain="positive",
                        physical_type="energy",
                    )

                    if np.isscalar(seed["energy"]) or seed["energy"].size == 1:
                        seed["photon_density"] = validate_scalar(
                            "{0}-density".format(name),
                            uu,
                            domain="positive",
                            physical_type="pressure",
                        )
                    else:
                        if uu.unit.physical_type == "pressure":
                            uu /= seed["energy"] ** 2
                        seed["photon_density"] = validate_array(
                            "{0}-density".format(name),
                            uu,
                            domain="positive",
                            physical_type="differential number density",
                        )
            else:
                raise TypeError(
                    "Unable to process seed photon"
                    " field: {0}".format(inseed)
                )

            result[name] = seed

        return result
234013
public void init(BaseField fldTarget, String fsTarget)
    {
        m_hsFilter = null;
        m_fldTarget = fldTarget;
        m_fsTarget = fsTarget;
        super.init(null);
    }
879694
def initialize_fields(self, content):
        
        for name, pair in enumerate(zip(self, content)):
            item, value = pair
            # Container or Pointer
            if is_mixin(item):
                item.initialize_fields(value)
            # Fields
            elif is_field(item):
                item.value = value
            else:
                raise MemberTypeError(self, item, name)