def set_attributes(self, el, pyobj):
if not hasattr(pyobj, self.attrs_aname):<EOL><INDENT>return<EOL><DEDENT>if not isinstance(getattr(pyobj, self.attrs_aname), dict):<EOL><INDENT>raise TypeError('<STR_LIT>'% self.attrs_aname)<EOL><DEDENT>for attr, value in list(getattr(pyobj, self.attrs_aname).items()):<EOL><INDENT>namespaceURI,localName = None, attr<EOL>if type(attr) in _seqtypes:<EOL><INDENT>namespaceURI, localName = attr<EOL><DEDENT>what = None<EOL>if getattr(self, '<STR_LIT>', None) is not None:<EOL><INDENT>what = self.attribute_typecode_dict.get(attr)<EOL>if what is None and namespaceURI is None:<EOL><INDENT>what = self.attribute_typecode_dict.get(localName)<EOL><DEDENT><DEDENT>if hasattr(value, '<STR_LIT>') and not isinstance(what, AnyType):<EOL><INDENT>if what is not None and not isinstance(value.typecode, what):<EOL><INDENT>raise EvaluateException('<STR_LIT>'%what.__class__)<EOL><DEDENT>what = value.typecode<EOL><DEDENT>self.logger.debug("<STR_LIT>", value)<EOL>if isinstance(what, QName):<EOL><INDENT>what.set_prefix(el, value)<EOL><DEDENT>if what is None:<EOL><INDENT>value = str(value)<EOL><DEDENT>else:<EOL><INDENT>value = what.get_formatted_content(value)<EOL><DEDENT>el.setAttributeNS(namespaceURI, localName, value)<EOL><DEDENT>
Instance data attributes contains a dictionary 
        of keys (namespaceURI,localName) and attribute values.
        These values can be self-describing (typecode), or use
        attribute_typecode_dict to determine serialization.
        Paramters:
            el -- MessageInterface representing the element
            pyobj --