Initializes the :class:`Field` members in the `Structure` with
        the *values* in the *content* dictionary.

        :param dict content: a dictionary contains the :class:`Field`
            values for each member in the `Structure`.
965249
def initialize_fields(self, content):
        
        for name, value in content.items():
            item = self[name]
            # 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)
764490
def content(self, value):
        

        if value is not None:
            assert type(value) is list, "'{0}' attribute: '{1}' type is not 'list'!".format("content", value)
        self.__content = value
953666
def set(self, uri, content):
        
        key, value = self._prepare_node(uri, content)
        self._set(key, value)
1342413
def initialize_fields(self):
        
        for field in dir(self):
            obj = getattr(self, field)
            if isinstance(obj, Field):
                self._meta.fields[field] = obj
998756
def _init_cat_dict(self, cat_dict_class, key_in_self, **kwargs):
        
        # Catch errors associated with crappy, but not unexpected data
        try:
            new_entry = cat_dict_class(self, key=key_in_self, **kwargs)
        except CatDictError as err:
            if err.warn:
                self._log.info("'{}' Not adding '{}': '{}'".format(self[
                    self._KEYS.NAME], key_in_self, str(err)))
            return None
        return new_entry
1144422
def init(self, key_value_pairs):
        
        for k, v in key_value_pairs.items():
            if k not in DatastoreLegacy.store[self.domain]:
                DatastoreLegacy.store[self.domain][k] = v
1032769
def p_content(self, content):
        ''''''
        content[0] = self.doctype(content[1], content[3], content[4], content[5])
        if self.toc:
            self.toc.set_articles([a for a in content[0].sections if isinstance(a, Article)])
691512
def loads(content, dict_=dict):
    
    if not isinstance(content, basestring):
        raise ValueError('The first parameter needs to be a string object, ',
                         '%r is passed' % type(content))
    decoder = Decoder(content, dict_)
    decoder.parse()
    return decoder.data
1255171
def _init_field(self, setting, field_class, name, code=None):
        
        kwargs = {
            "label": setting["label"] + ":",
            "required": setting["type"] in (int, float),
            "initial": getattr(settings, name),
            "help_text": self.format_help(setting["description"]),
        }
        if setting["choices"]:
            field_class = forms.ChoiceField
            kwargs["choices"] = setting["choices"]
        field_instance = field_class(**kwargs)
        code_name = ('_modeltranslation_' + code if code else '')
        self.fields[name + code_name] = field_instance
        css_class = field_class.__name__.lower()
        field_instance.widget.attrs["class"] = css_class
        if code:
            field_instance.widget.attrs["class"] += " modeltranslation"
973324
def __init(self):
        
        params = {
            "f" : "json"
        }
        json_dict = self._get(url=self._currentURL,
                                 param_dict=params,
                                 securityHandler=self._securityHandler,
                                 proxy_url=self._proxy_url,
                                 proxy_port=self._proxy_port)
        self._json = json.dumps(json_dict)
        self._json_dict = json_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.lower() == "extensions":
                self._extensions = []
                for ext in v:
                    self._extensions.append(Extension.fromJSON(ext))
                    del ext
            elif k in attributes:
                setattr(self, "_"+ k, json_dict[k])
            else:
                print( k, " - attribute not implemented in manageags.AGSService.")
            del k
            del v
1305639
def initialize(self,*args,**kwargs):
        
        super(JSONHandler,self).initialize(*args,**kwargs)
        content_type = self.request.headers.get('Content-Type', '')
        if 'application/json' in content_type.lower():
            self._parse_json_body_arguments()
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.")
378340
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._json = json.dumps(json_dict, default=self._date_handler)
        attributes = [attr for attr in dir(self)
                      if not attr.startswith('__') and \
                      not attr.startswith('_')]
        for k,v in json_dict.items():
            if k in attributes:
                setattr(self, "_"+ k, json_dict[k])
            else:
                print("%s - attribute not implemented in Feature Layer." % k)
        if self._parentLayer is None:
            self._parentLayer = FeatureService(
                url=os.path.dirname(self._url),
                securityHandler=self._securityHandler,
                proxy_port=self._proxy_port,
                proxy_url=self._proxy_url, initialize=False)
1102689
def initFromDict(self, adict, **kwargs):
            
            # First, flatten the dictionary into a dictionary of paths/files
            a_flat  = C_stree.flatten(adict)

            l_dir   = []
            # Now, build a tree from this structure by generating a list of paths
            for k, v in a_flat.items():
                l_dir.append(k.split('/')[1:-1])

            # remove duplicates...
            l_dir = [list(x) for x in set(tuple(x) for x in l_dir)]

            # build sorted list of paths...
            l_path  = ['/' + '/'.join(p) for p in l_dir]
            l_path.sort()

            # build the tree
            for dir in l_path: self.mkdir(dir)

            # and now add the leaves
            for file,contents in a_flat.items(): self.touch(file, contents)
352720
function (content) {
      var fileContent = self._readFileSync();

      fileContent.instances = fileContent.instances || {};
      fileContent.instances[this._id] = content;
      self._writeFileSync(fileContent);
    }
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
1013937
def start(self, content):
        
        content.data = Factory.object(content.node.name)