def register_namespace(self, prefix, uri):
        """Registers a namespace,, making it available for use when adding subsequent fields to the entry.
        
        Registration will also affect the XML export, adding in the xmlns:prefix="url" attribute when required."""
        try:
            etree.register_namespace(prefix, uri)
        except __HOLE__ as e:
            # the etree implementation we're using doesn't support register_namespace
            # (probably lxml)
            pass
        self.add_ns.append(prefix)
        if prefix not in NS.keys():
            NS[prefix] = "{%s}%%s" % uri
            
        # we also have to handle namespaces internally, for etree implementations which
        # don't support register_namespace
        if prefix not in self.nsmap.keys():
            self.nsmap[prefix] = uri
dataset/ETHPy150Open swordapp/python-client-sword2/sword2/atom_objects.py/Entry.register_namespace