def hasattr(self, attr, ns=None):
if not self.__attributes:<EOL><INDENT>self.setAttributeDictionary()<EOL><DEDENT>if ns:<EOL><INDENT>return attr in self.__attributes.get(ns,{})<EOL><DEDENT>return attr in self.__attributes<EOL>
attr -- attribute 
           ns -- optional namespace, None means unprefixed attribute.