def update(self, other, copy=True, *args, **kwargs):
super(CompositeModelElement, self).update(<EOL>other, copy=copy, *args, **kwargs<EOL>)<EOL>if other:  <EOL><INDENT>contents = []<EOL>if isinstance(other, self.__class__):<EOL><INDENT>contents = list(other.values())<EOL><DEDENT>elif isinstance(other, self.__contenttype__):<EOL><INDENT>contents = [other]<EOL><DEDENT>else:<EOL><INDENT>raise TypeError(<EOL>'<STR_LIT>'.format(self, other)<EOL>)<EOL><DEDENT>for content in contents:<EOL><INDENT>selfcontent = self.get(content.name)<EOL>if selfcontent is None:<EOL><INDENT>if copy:<EOL><INDENT>content = content.copy(local=False)<EOL><DEDENT>self[content.name] = content<EOL><DEDENT>else:<EOL><INDENT>selfcontent.update(content, copy=copy, *args, **kwargs)<EOL><DEDENT><DEDENT><DEDENT>return self<EOL>
Update this composite model element with other element content.

        :param other: element to update with this. Must be the same type of this
            or this __contenttype__.
        :param bool copy: copy other before updating.
        :return: self