Initialize each fields of the fields_desc dict
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)
418150
function initField(target, property, desc) {
        let value = desc.initializer();

        hook(actionSet, action => {
            value = action.payload;
        })

        delete desc.initializer;
        delete desc.writable;

        desc.get = function() {
            return value;
        }
        desc.set = function() {
        }

        return desc;
    }
1364179
private List<FieldNode> getFieldsByDesc(String desc, List<FieldNode> fields) {
        List<FieldNode> result = new ArrayList<FieldNode>();
        for (FieldNode fn : fields) {
            if (desc.equals(fn.desc)) {
                result.add(fn);
            }
        }
        return result;
    }
174321
def make_field_objects(field_data, names):
        # type: (List[Dict[Text, Text]], Names) -> List[Field]
        """"""
        field_objects = []
        field_names = []  # type: List[Text]
        for field in field_data:
            if hasattr(field, 'get') and callable(field.get):
                atype = cast(Text, field.get('type'))
                name = cast(Text, field.get('name'))

                # null values can have a default value of None
                has_default = False
                default = None
                if 'default' in field:
                    has_default = True
                    default = field.get('default')

                order = field.get('order')
                doc = field.get('doc')
                other_props = get_other_props(field, FIELD_RESERVED_PROPS)
                new_field = Field(atype, name, has_default, default, order, names, doc,
                                 other_props)
                # make sure field name has not been used yet
                if new_field.name in field_names:
                    fail_msg = 'Field name %s already in use.' % new_field.name
                    raise SchemaParseException(fail_msg)
                field_names.append(new_field.name)
            else:
                raise SchemaParseException('Not a valid field: %s' % field)
            field_objects.append(new_field)
        return field_objects
1241977
def iter_field_objects(fields):
    
    if isinstance(fields, dict):
        i = six.iteritems(fields)
    else:
        i = iter(fields)

    for field in i:
        if isinstance(field, RequestField):
            yield field
        else:
            yield RequestField.from_tuples(*field)
822509
def _dict_to_fields(d, jsonify=True):
    
    x = []
    for k in constants._keys:
        v = d[k]
        if jsonify and (k in ('attributes', 'extra')):
            x.append(_jsonify(v))
        else:
            x.append(v)
    return tuple(x)
375000
def __init(self):
        
        params = {
            "f" : "json",
        }

        json_dict = self._get(self._url, params,
                                 securityHandler=self._securityHandler,
                                 proxy_port=self._proxy_port,
                                 proxy_url=self._proxy_url)
        self._json_dict = json_dict
        self._dict = json_dict
        self._json = json.dumps(self._dict)
        attributes = [attr for attr in dir(self)
                      if not attr.startswith('__') and \
                      not attr.startswith('_')]
        for k,v in json_dict.items():
            if k == "layers":
                self._layers = []
                for lyr in v:
                    fl = AdminFeatureServiceLayer(url=self._url + "/%s" % lyr['id'],
                                                  securityHandler=self._securityHandler,
                                                  proxy_port=self._proxy_port,
                                                  proxy_url=self._proxy_url)
                    fl.loadAttributes(json_dict = lyr)
                    self._layers.append(fl)
                    del fl
                    del lyr
            elif k == "tables":
                self._tables = []
                for lyr in v:
                    fl = AdminFeatureServiceLayer(url=self._url + "/%s" % lyr['id'],
                                                  securityHandler=self._securityHandler,
                                                  proxy_port=self._proxy_port,
                                                  proxy_url=self._proxy_url)
                    fl.loadAttributes(json_dict = lyr)
                    self._tables.append(fl)
                    del fl
                    del lyr
            elif k in attributes:
                setattr(self, "_"+ k, json_dict[k])
            else:
                print( k, " - attribute not implemented in AdminFeatureService.")
1188931
def loadedfields(self):
        ''''''
        if self._loadedfields is None:
            for field in self._meta.scalarfields:
                yield field
        else:
            fields = self._meta.dfields
            processed = set()
            for name in self._loadedfields:
                if name in processed:
                    continue
                if name in fields:
                    processed.add(name)
                    yield fields[name]
                else:
                    name = name.split(JSPLITTER)[0]
                    if name in fields and name not in processed:
                        field = fields[name]
                        if field.type == 'json object':
                            processed.add(name)
                            yield field
426300
def get_fields(cls):
        
        fields = {}
        for field_name in dir(cls):
            if isinstance(getattr(cls, field_name), Field):
                field = getattr(cls, field_name)
                field_name = field.field_name or field_name
                fields[field_name] = field
        return fields
762674
def to_dict(self):
        
        return {field_name: getattr(self, field_name, None)
                for field_name in self.meta_.declared_fields}
825523
def data(self):
        '''
        '''
        d = {}
        for val, key in self._fields.items():
            val = getattr(self, val)
            if val is not None:
                d[key] = val
        return d
990703
def add_fields(self, field_dict):
    
    for key, field in field_dict.items():
      self.add_field(key, field)
171914
protected function initSchemaFields()
    {
        $schema = static::getSchemaFields();
        $parser = static::getDatabase()->getParser();

        // prepare field values strip schema definitions
        foreach ($schema as $field) {
            $this->{$field} = $parser->getNotationValue($this->{$field});
        }
    }
282899
def _all_fields(self):
        
        if (
            not settings.ENABLE_FIELDS_CACHE or
            not self.ENABLE_FIELDS_CACHE or
            self.__class__ not in FIELDS_CACHE
        ):
            all_fields = super(
                WithDynamicSerializerMixin,
                self
            ).get_fields()

            if (
                settings.ENABLE_FIELDS_CACHE and
                self.ENABLE_FIELDS_CACHE
            ):
                FIELDS_CACHE[self.__class__] = all_fields
        else:
            all_fields = copy.copy(FIELDS_CACHE[self.__class__])
            for k, field in six.iteritems(all_fields):
                if hasattr(field, 'reset'):
                    field.reset()

        for k, field in six.iteritems(all_fields):
            field.field_name = k
            field.parent = self

        return all_fields
352448
def add_fields(self, **fields):
        
        query = {}
        for field in fields:
            query[field] = fields[field]
        self._q.append({'$addFields': query})
        return self
335085
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'fields' in _dict:
            args['fields'] = [
                Field._from_dict(x) for x in (_dict.get('fields'))
            ]
        return cls(**args)
840079
def fields(self):
        ''''''
        out = dict()
        for operator in self.ops:
            out.update(**operator.fields)

        return out