Extend Field.from_dict, set display/display_international 
        attributes.
329013
def from_dict(cls, d):
        """"""
        phone = super(cls, cls).from_dict(d)
        phone.display = d.get('display', u'')
        phone.display_international = d.get('display_international', u'')
        return phone
241700
def extend_nonlocals(bind)
      bind.eval('instance_variables').each do |var|
        @binding.eval('self').instance_variable_set var, bind.eval(var.to_s)
      end

      bind.eval('self.class.class_variables').each do |var|
        @binding.eval('self').class_variable_set var, bind.eval(var.to_s)
      end
    end
162079
def extend(self, values):
        """"""
        if self.asserted:
            raise RuntimeError("Fact already asserted")

        self._multifield.extend(values)
65955
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'customizations' in _dict:
            args['customizations'] = [
                LanguageModel._from_dict(x)
                for x in (_dict.get('customizations'))
            ]
        else:
            raise ValueError(
                'Required property \'customizations\' not present in LanguageModels JSON'
            )
        return cls(**args)
1080130
def _initialize_from_model(self, model):
        
        for name, value in model.__dict__.items():
            if name in self._properties:
                setattr(self, name, value)
748277
def _init_fields(self):
        """"""
        if self.opts.fields:
            available_field_names = self.set_class(self.opts.fields)
        else:
            available_field_names = self.set_class(self.declared_fields.keys())
            if self.opts.additional:
                available_field_names |= self.set_class(self.opts.additional)

        invalid_fields = self.set_class()

        if self.only is not None:
            # Return only fields specified in only option
            field_names = self.set_class(self.only)

            invalid_fields |= field_names - available_field_names
        else:
            field_names = available_field_names

        # If "exclude" option or param is specified, remove those fields.
        exclude_field_names = set(self.opts.exclude) | set(self.exclude)
        if exclude_field_names:
            # Note that this isn't available_field_names, since we want to
            # apply "only" for the actual calculation.
            field_names = field_names - exclude_field_names

            invalid_fields |= exclude_field_names - available_field_names

        if invalid_fields:
            message = 'Invalid fields for {}: {}.'.format(self, invalid_fields)
            raise ValueError(message)

        fields_dict = self.dict_class()
        for field_name in field_names:
            field_obj = self.declared_fields.get(field_name, ma_fields.Inferred())
            self._bind_field(field_name, field_obj)
            fields_dict[field_name] = field_obj

        dump_data_keys = [
            obj.data_key or name for name, obj in iteritems(fields_dict) if not obj.load_only
        ]
        if len(dump_data_keys) != len(set(dump_data_keys)):
            data_keys_duplicates = {x for x in dump_data_keys if dump_data_keys.count(x) > 1}
            raise ValueError(
                'The data_key argument for one or more fields collides '
                "with another field's name or data_key argument. "
                'Check the following field names and '
                'data_key arguments: {}'.format(list(data_keys_duplicates)),
            )

        load_attributes = [
            obj.attribute or name for name, obj in iteritems(fields_dict) if not obj.dump_only
        ]
        if len(load_attributes) != len(set(load_attributes)):
            attributes_duplicates = {x for x in load_attributes if load_attributes.count(x) > 1}
            raise ValueError(
                'The attribute argument for one or more fields collides '
                "with another field's name or attribute argument. "
                'Check the following field names and '
                'attribute arguments: {}'.format(list(attributes_duplicates)),
            )

        return fields_dict
386871
def override(self, obj):
        """"""
        for field in obj.__class__.export_fields:
            setattr(self, field, getattr(obj, field))
698373
function extend (to, _from) {
  for (const key in _from) {
    to[key] = _from[key];
  }
  return to
}
726023
def localize_field(self, value):
        
        if self.default is not None:
            if value is None or value == '':
                value = self.default
        return value or ''
270007
def _initialize_indices(model_class, name, bases, attrs):
    """"""
    model_class._indices = []
    for k, v in attrs.iteritems():
        if isinstance(v, (Attribute, ListField)) and v.indexed:
            model_class._indices.append(k)
    if model_class._meta['indices']:
        model_class._indices.extend(model_class._meta['indices'])
37322
private static void addLocaleField(TypeSpec.Builder type, String name, LocaleID locale) {
    FieldSpec.Builder field = FieldSpec.builder(CLDR_LOCALE_IF, name, PUBLIC, STATIC, FINAL)
        .initializer("new $T($S, $S, $S, $S)",
            META_LOCALE,
            strOrNull(locale.language), 
            strOrNull(locale.script),
            strOrNull(locale.territory),
            strOrNull(locale.variant));
    type.addField(field.build());
  }
445793
def extend_schema_spec(self) -> None:
        
        super().extend_schema_spec()

        identity_field = {
            'Name': '_identity',
            'Type': BtsType.STRING,
            'Value': 'identity',
            ATTRIBUTE_INTERNAL: True
        }

        if self.ATTRIBUTE_FIELDS in self._spec:
            self._spec[self.ATTRIBUTE_FIELDS].insert(0, identity_field)
            self.schema_loader.add_schema_spec(identity_field, self.fully_qualified_name)
779776
def field_from_json(self, key_and_type, json_value):
        """"""
        assert ':' in key_and_type
        key, type_code = key_and_type.split(':', 1)
        from_json = self.field_function(type_code, 'from_json')
        value = from_json(json_value)
        return key, value
872034
def fill_with_model(self, model, *fields):
        
        model_dct = model.to_dict(include=self._fields.keys())
        localized_dct = self.localize(*fields, **model_dct)
        if model.key:
            localized_dct['id'] = model.key.id()
        return localized_dct
219305
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'custom_language_model' in _dict:
            args['custom_language_model'] = _dict.get('custom_language_model')
        else:
            raise ValueError(
                'Required property \'custom_language_model\' not present in SupportedFeatures JSON'
            )
        if 'speaker_labels' in _dict:
            args['speaker_labels'] = _dict.get('speaker_labels')
        else:
            raise ValueError(
                'Required property \'speaker_labels\' not present in SupportedFeatures JSON'
            )
        return cls(**args)
1088414
def __setImports(self, schema):
        
        for ns,val in schema.imports.items(): 
            if self._imports.has_key(ns):
                schema.addImportSchema(self._imports[ns])
974909
def addfield(self, pkt, s, val):
        """"""
        tmp_len = self.length_of(pkt)
        if tmp_len == 0:
            return s
        internal = self.i2m(pkt, val)[-tmp_len:]
        return s + struct.pack("!%ds" % tmp_len, internal)