def getAttr(self, node, name, nsuri=None, default=join):
if nsuri is None:<EOL><INDENT>result = node._attrs.get(name, None)<EOL>if result is None:<EOL><INDENT>for item in list(node._attrsNS.keys()):<EOL><INDENT>if item[<NUM_LIT:1>] == name:<EOL><INDENT>result = node._attrsNS[item]<EOL>break<EOL><DEDENT><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>result = node._attrsNS.get((nsuri, name), None)<EOL><DEDENT>if result is not None:<EOL><INDENT>return result.value<EOL><DEDENT>if default is not join:<EOL><INDENT>return default<EOL><DEDENT>return '<STR_LIT>'<EOL>
Return the value of the attribute named 'name' with the
           optional nsuri, or the default if one is specified. If
           nsuri is not specified, an attribute that matches the
           given name will be returned regardless of namespace.