code: def hasAttr(self, node, name, nsuri=None):
          
          if nsuri is None:
              if node.hasAttribute(name):
                  return True
              return False
          return node.hasAttributeNS(nsuri, name)
docs: Return true if element has attribute with the given name and
             optional nsuri. If nsuri is not specified, returns true if an
             attribute exists with the given name with any namespace.