Provide the attributes to auto fill them
499725
protected function autoAssignAttributes()
    {
        $attributes = isset($this->defaultAttributes) ? $this->defaultAttributes : [];
        // Default attributes are not counted as "from storage"
        $this->fillAttributes($attributes, false);
    }
55817
public function addMissingAttributes()
    {
        foreach ($this->getSchema() as $key => $settings) {
            if (!array_has($this->attributes, $key)) {
                array_set($this->attributes, $key, array_get($settings, 'default', null));
            }
        }
    }
1098459
def extend(self, attributes, prefix):
        

        self._contents += [Attribute(attr, prefix) for attr in attributes]
1159797
def build_attrs(self, *args, **kwargs):
        """"""
        attrs = super(CaptchaAnswerInput, self).build_attrs(*args, **kwargs)
        attrs['autocapitalize'] = 'off'
        attrs['autocomplete'] = 'off'
        attrs['autocorrect'] = 'off'
        attrs['spellcheck'] = 'false'
        return attrs
1329707
def apply_attributes(node: Node, **_):
    """"""
    for attr in node.xml_node.attrs:
        apply_attribute(node, attr)
1347477
def _set_django_attributes(span, request):
    """"""
    django_user = getattr(request, 'user', None)

    if django_user is None:
        return

    user_id = django_user.pk
    try:
        user_name = django_user.get_username()
    except AttributeError:
        # AnonymousUser in some older versions of Django doesn't implement
        # get_username
        return

    # User id is the django autofield for User model as the primary key
    if user_id is not None:
        span.add_attribute('django.user.id', str(user_id))

    if user_name is not None:
        span.add_attribute('django.user.name', str(user_name))
274124
def initialize_attributes(attributes)
      @_attributes = attributes
      attributes.each do |key, value|
        send("#{key}=", value) if respond_to? key
      end
    end
567464
function(el, attr, val) {
            Y.Dom.batch(el, Y.Dom._setAttribute, { attr: attr, val: val });
        }
424850
function _fillMissingFields(attrs) {
  var attr;
  for(var i = 0; i < attrs.length; ++i) {
    attr = attrs[i];

    // populate missing name
    if(typeof attr.name === 'undefined') {
      if(attr.type && attr.type in pki.oids) {
        attr.name = pki.oids[attr.type];
      } else if(attr.shortName && attr.shortName in _shortNames) {
        attr.name = pki.oids[_shortNames[attr.shortName]];
      }
    }

    // populate missing type (OID)
    if(typeof attr.type === 'undefined') {
      if(attr.name && attr.name in pki.oids) {
        attr.type = pki.oids[attr.name];
      } else {
        var error = new Error('Attribute type not specified.');
        error.attribute = attr;
        throw error;
      }
    }

    // populate missing shortname
    if(typeof attr.shortName === 'undefined') {
      if(attr.name && attr.name in _shortNames) {
        attr.shortName = _shortNames[attr.name];
      }
    }

    // convert extensions to value
    if(attr.type === oids.extensionRequest) {
      attr.valueConstructed = true;
      attr.valueTagClass = asn1.Type.SEQUENCE;
      if(!attr.value && attr.extensions) {
        attr.value = [];
        for(var ei = 0; ei < attr.extensions.length; ++ei) {
          attr.value.push(pki.certificateExtensionToAsn1(
            _fillMissingExtensionFields(attr.extensions[ei])));
        }
      }
    }

    if(typeof attr.value === 'undefined') {
      var error = new Error('Attribute value not specified.');
      error.attribute = attr;
      throw error;
    }
  }
}
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]))
86961
protected function fillDataForEmpty()
    {
        // Fill export columns if they are empty
        $columns = [];

        $foreignKeys = $this->collectForeignKeys();

        // Add columns for attributes
        foreach ($this->info->attributes as $attribute) {

            if ($attribute->hidden || in_array($attribute->name, $foreignKeys)) {
                continue;
            }

            $columns[ $attribute->name ] = $this->makeModelExportColumnDataForAttributeData($attribute);
        }

        $this->info->export->columns = $columns;
    }
361081
def _auto_fill_defaults(cls):
        """"""
        if not cls.spec.appname:
            cls.spec.appname = get_basename(get_program_path())
        if not cls.spec.dev:
            cls.spec.dev = get_dev_folder()
1037570
def from_auto_dict(values, source='auto'):
    '''
    

    '''
    for name, value in values.items():
        values[name] = from_auto(name, value, source)

    return values
541948
def fill_form(form, data):
    
    for (key, value) in data.items():
        if hasattr(form, key):
            if isinstance(value, dict):
                fill_form(getattr(form, key), value)
            else:
                getattr(form, key).data = value
    return form
593988
def attributes(atts = {}, for_definition = false)
      wrapped_attributes atts, for_definition
      attributes_assignments atts, false, for_definition
      atts
    end
1112066
function(attributes, options) {
    var attrs = attributes || {};
    options || (options = {});
    this.cid = _.uniqueId('c');
    this.attributes = {};
    if (options.collection) this.collection = options.collection;
    if (options.parse) attrs = this.parse(attrs, options) || {};
    this._schema = this.schema();
    this._defaults = this.defaults(undefined, true);
    attrs = _.defaultsDeep({}, attrs, this.defaults(undefined, false));
    this.set(attrs, options);
    this.changed = {};
    this.initialize.apply(this, arguments);
  }
285557
def autofill(*autofill_fields):
    
    def wrap( reader ):
        def wrapped_reader( *args, **kw ):
            rec = reader( *args, **kw )
            if rec is not None:
                for field in autofill_fields:
                    if field == "opcode" and 'opcode' not in rec.keys():
                        assert 'op' in rec.keys(), "BUG: record is missing 'op'"
                        rec['opcode'] = op_get_opcode_name(rec['op'])
                    else:
                        raise Exception("Unknown autofill field '%s'" % field)

            return rec
        return wrapped_reader
    return wrap