Initialize attribute with a value. Priority to the value set in the
contructor args.
974193
function buildViewAttribsInit( attName, attValue, code ) {
    try {
        if ( typeof attValue === "undefined" ) {
            // code.section.attribs.init.push(`this.${attName} = args[${JSON.stringify(attName)}];`);
            code.section.attribs.init
                .push( `pm.set("${attName}", args[${JSON.stringify(attName)}]);` );
        } else {
            code.functions.defVal = "(args, attName, attValue) " +
                "{ return args[attName] === undefined ? attValue : args[attName]; }";
            // code.section.attribs.init.push( "this." + attName + " = defVal(args, " +
            //    JSON.stringify( attName ) + ", " + JSON.stringify( attValue ) +
            //    ");" );
            code.section.attribs.init
                .push( `pm.set("${attName}", defVal(args, "${attName}", ${JSON.stringify( attValue )}));` );
        }
    } catch ( ex ) {
        bubble(
            ex,
            `buildViewAttribsInit(${attName}, ${JSON.stringify(attValue)})`
        );
    }
}
727281
def add_attribute_value_initializer
      class << self
        def new(opts=nil)
          obj = super()
          obj.post_initialize
          obj.merge_attributes(opts) if opts
          obj
        end
      end
      logger.debug { "#{self} is extended with an optional {attribute=>value} constructor parameter." }
    end
6909
def setProperty(self, prop: str, value: str, priority: str = None
                    ) -> None:
        
        self[prop] = value
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)
118996
def setAttribute(self, attr: str, value: _AttrValueType) -> None:
        """"""
        self._set_attribute(attr, value)
1072307
def pre_init(self, value, obj):
        """"""

        try:
            if obj._state.adding:
                # Make sure the primary key actually exists on the object before
                # checking if it's empty. This is a special case for South datamigrations
                # see: https://github.com/bradjasper/django-jsonfield/issues/52
                if getattr(obj, "pk", None) is not None:
                    if isinstance(value, six.string_types):
                        try:
                            return json.loads(value, **self.load_kwargs)
                        except ValueError:
                            raise ValidationError(_("Enter valid JSON"))

        except AttributeError:
            # south fake meta class doesn't create proper attributes
            # see this:
            # https://github.com/bradjasper/django-jsonfield/issues/52
            pass

        return value
477421
def initialized(self, value):
        

        if value is not None:
            assert type(value) is bool, "'{0}' attribute: '{1}' type is not 'bool'!".format("initialized", value)
        self.__initialized = value
1051788
def postinit(self, dest=None, values=None):
        
        self.dest = dest
        self.values = values
813850
def init(obj, resource_root, attrs=None):
    
    # This works around http://bugs.python.org/issue2646
    # We use unicode strings as keys in kwargs.
    str_attrs = { }
    if attrs:
      for k, v in attrs.iteritems():
        if k not in ('self', 'resource_root'):
          str_attrs[k] = v
    BaseApiObject.__init__(obj, resource_root, **str_attrs)
605526
def initialize(self, init_value, context=None, force=False):
        

        if not force and self._instance is not None:
            raise ConfigurationAlreadyInitializedError(
                'Configuration manager object is already initialized.'
            )

        self.__class__._instance = Root(init_value, context=context)
383093
public final T setAttributeValueAsInteger(String name, int value) {
    setAttribute(name, Integer.toString(value));
    return (T)this;
  }
787023
def _initialize_attributes(self, data):
    """"""
    attrs = dict(self.attrs)

    if self.primary_key_name is None:
      pass
    elif isinstance(self.primary_key_name, str):
      if self.primary_key_name not in attrs:
        attrs[self.primary_key_name] = None
    else:
      for pkey in self.primary_key_name:
        if pkey not in attrs:
          attrs[pkey] = None

    if self.timestamps:
      for ts_name in self.timestamps:
        if ts_name is not None and ts_name not in attrs:
          attrs[ts_name] = None

    for attr_name in attrs:
      setattr(self, attr_name, get_value(data, attr_name, attrs[attr_name]))
972515
public static PriorityAttribute createPriorityAttribute(long priority)
			throws IllegalArgumentException {
		PriorityAttribute attribute = new PriorityAttribute();

		attribute.setPriority(priority);

		return attribute;
	}
1020298
def _pfp__set_value(self, value):
        
        if self._pfp__frozen:
            raise errors.UnmodifiableConst()
        if len(value) != len(self._pfp__children):
            raise errors.PfpError("struct initialization has wrong number of members")

        for x in six.moves.range(len(self._pfp__children)):
            self._pfp__children[x]._pfp__set_value(value[x])
1180849
public static void setAttribute(String key, Object value) {
        assertInitialized();
        getAppFramework().setAttribute(key, value);
    }
1214028
def SetAttribute(self, attribute):
    """"""
    # Grab the attribute registered for this name
    self.attribute = attribute
    self.attribute_obj = Attribute.GetAttributeByName(attribute)
    if self.attribute_obj is None:
      raise lexer.ParseError("Attribute %s not defined" % attribute)
1159011
def prioritized_iter(cls, flag_val, env_val, config_val, config_default_val,
                       hardcoded_val, default):
    """"""
    if flag_val is not None:
      yield RankedValue(cls.FLAG, flag_val)
    if env_val is not None:
      yield RankedValue(cls.ENVIRONMENT, env_val)
    if config_val is not None:
      yield RankedValue(cls.CONFIG, config_val)
    if config_default_val is not None:
      yield RankedValue(cls.CONFIG_DEFAULT, config_default_val)
    if hardcoded_val is not None:
      yield RankedValue(cls.HARDCODED, hardcoded_val)
    yield RankedValue(cls.NONE, default)