Serialize the dictionary and append all serialized children to the element.
356675
def _serialize(
            self,
            element,  # type: ET.Element
            value,  # type: Dict
            state  # type: _ProcessorState
    ):
        # type: (...) -> None
        """"""
        for child in self._child_processors:
            state.push_location(child.element_path)
            child_value = value.get(child.alias)
            child.serialize_on_parent(element, child_value, state)
            state.pop_location()
888570
def flatten(self) :
		""""""
		if len(self.children) > 1 :
			children = self.children
			self.emptyChildren()
			
			children[0].emptyChildren()
			x1 = children[0].x1
			x2 = children[0].x2
			refObjs = [children[0].referedObject]
			name = children[0].name
			
			for i in range(1, len(children)) :
				children[i].emptyChildren()
				if children[i-1] >= children[i] :
					x2 = children[i].x2
					refObjs.append(children[i].referedObject)
					name += " U " + children[i].name
				else :
					if len(refObjs) == 1 :
						refObjs = refObjs[0]
		
					self.insert(x1, x2, name, refObjs)
					x1 = children[i].x1
					x2 = children[i].x2
					refObjs = [children[i].referedObject]
					name = children[i].name
			
			if len(refObjs) == 1 :
				refObjs = refObjs[0]
		
			self.insert(x1, x2, name, refObjs)
1296491
def serialize(self, data):
        

        super(Serializer, self).serialize(data)
        self.resp.body = json.dumps(data)
1216885
def appendChild(self, child):
		
		self.childNodes.append(child)
		child.parentNode = self
		self._verifyChildren(len(self.childNodes) - 1)
		return child
803700
def serialize(dictionary):
    

    data = []
    for key, value in dictionary.items():
        data.append('{0}="{1}"'.format(key, value))
    return ', '.join(data)
68579
def serialize(self, occur=None):
        
        fmt = self.ser_format.get(self.name, SchemaNode._default_format)
        return fmt(self, occur) % (escape(self.text) +
                                   self.serialize_children())
658657
def serialize(self, obj, fields):
        

        data = {}
        remaining_fields = []
        for field in fields:
            if callable(field):  # Callable
                data[field.__name__] = field(obj)
            elif hasattr(self, field) and callable(getattr(self, field)):  # Method on the view
                data[field] = getattr(self, field)(obj)
            elif hasattr(obj, field):  # Callable/property/field on the model
                attr = getattr(obj, field)
                if isinstance(attr, Model):
                    data[field] = attr.pk
                elif isinstance(attr, Manager):
                    data[field] = [item['pk'] for item in attr.values('pk')]
                elif callable(attr):  # Callable on the model
                    data[field] = attr()
                else:
                    remaining_fields.append(field)
            else:
                raise AttributeError('Invalid field: %s' % field)

        # Add on db fields
        serializer = Serializer()
        serializer.serialize([obj], fields=list(remaining_fields))
        data.update(serializer.getvalue()[0]['fields'])

        # Any remaining fields should be properties on the model
        remaining_fields = set(remaining_fields) - set(data.keys())

        for field in remaining_fields:
            data[field] = getattr(obj, field)

        return data
660666
def serialise(self, element: Element, **kwargs) -> str:
        

        return json.dumps(self.serialise_dict(element), **kwargs)
132025
def _serialize(cls, key, value, fields):
        
        converter = cls._get_converter_for_field(key, None, fields)
        return converter.serialize(value)
637042
def append(self, child, *args, **kwargs):
        """"""
        #if no set is associated with the layer yet, we learn it from span annotation elements that are added
        if self.set is False or self.set is None:
            if inspect.isclass(child):
                if issubclass(child,AbstractSpanAnnotation):
                    if 'set' in kwargs:
                        self.set = kwargs['set']
            elif isinstance(child, AbstractSpanAnnotation):
                if child.set:
                    self.set = child.set
            elif isinstance(child, Correction):
                #descend into corrections to find the proper set for this layer (derived from span annotation elements)
                for e in itertools.chain( child.new(), child.original(), child.suggestions() ):
                    if isinstance(e, AbstractSpanAnnotation) and e.set:
                        self.set = e.set
                        break

        return super(AbstractAnnotationLayer, self).append(child, *args, **kwargs)
1156052
def _serialize(
            self,
            array_parent,  # type: ET.Element
            value,  # type: List
            state  # type: _ProcessorState
    ):
        # type: (...) -> None
        """"""
        if not value:
            # Nothing to do. Avoid attempting to iterate over a possibly
            # None value.
            return

        for i, item_value in enumerate(value):
            state.push_location(self._item_processor.element_path, i)
            item_element = self._item_processor.serialize(item_value, state)
            array_parent.append(item_element)
            state.pop_location()
1083840
def dict_to_serialized_dict(ref, the_dict):
    
    result = {}
    for elt in list(the_dict.values()):
        if not getattr(elt, 'serialize', None):
            continue
        result[elt.uuid] = elt.serialize()
    return result
905880
def render_children(node: Node, **child_args):
    """"""
    for xml_node in node.xml_node.children:
        child = render(xml_node, **child_args)
        node.add_child(child)
928022
def append(self, child, *args, **kwargs):
        """"""
        e = super(AbstractStructureElement,self).append(child, *args, **kwargs)
        self._setmaxid(e)
        return e
1064709
def _serialize(self, value, key, obj):
        
        param_values = {}
        for name, attr_tpl in iteritems(self.params):
            attr_name = _tpl(str(attr_tpl))
            if attr_name:
                attribute_value = _get_value(obj, attr_name, default=missing)
                if attribute_value is None:
                    return None
                if attribute_value is not missing:
                    param_values[name] = attribute_value
                else:
                    raise AttributeError(
                        "{attr_name!r} is not a valid "
                        "attribute of {obj!r}".format(attr_name=attr_name, obj=obj)
                    )
            else:
                param_values[name] = attr_tpl
        return url_for(self.endpoint, **param_values)
921964
def serialize(self, serializable: Optional[Union[SerializableType, List[SerializableType]]]) \
            -> PrimitiveJsonType:
        
        if serializable is None:
            # Implements #17
            return None
        elif isinstance(serializable, List):
            return [self.serialize(item) for item in serializable]
        else:
            serialized = self._create_serialized_container()

            for mapping in self._property_mappings:
                if mapping.object_property_getter is not None and mapping.serialized_property_setter is not None:
                    value = mapping.object_property_getter(serializable)
                    if not (mapping.optional and value is None):
                        if isinstance(value, type(mapping.collection_factory([]))):
                            value = list(mapping.collection_iter(value))
                        encoded_value = self._serialize_property_value(value, mapping.serializer_cls)
                        mapping.serialized_property_setter(serialized, encoded_value)

            return serialized
565637
def serialize
      serialized = {}

      # set basic info
      serialized[:id] = id
      serialized[:title] = title
      serialized[:subtitle] = subtitle
      serialized[:excerpt] = excerpt
      serialized[:content] = content
      serialized[:seo_description] = seo_description
      serialized[:meta_language] = meta_language
      serialized[:meta_permalink] = meta_permalink
      serialized[:meta_status] = meta_status

      # add fields informations
      serialized[:fields] = serialize_fields

      # add categories informations
      serialized[:categories] = serialize_categories

      # add tags informations
      serialized[:tags] = serialize_tags

      # add post parent informations
      serialized[:other_informations] = serialize_other_informations

      # return serialized post
      serialized
    end