def _get_ns(self, reply):
def get_prefix(url):<EOL><INDENT>if url in special_prefixes:<EOL><INDENT>return special_prefixes[url]<EOL><DEDENT>for i in self.namespaces:<EOL><INDENT>if url == i[<NUM_LIT:2>]:<EOL><INDENT>return i[<NUM_LIT:1>]<EOL><DEDENT><DEDENT>return None<EOL><DEDENT>root = reply.getroottree()<EOL>urls = set()<EOL>for node in root.iter():<EOL><INDENT>urls.update([u for p, u in node.nsmap.items()])<EOL><DEDENT>ret = {url: get_prefix(url) for url in urls}<EOL>i = <NUM_LIT:0><EOL>for url in [url for url in ret if ret[url] is None]:<EOL><INDENT>logger.warning('<STR_LIT>''<STR_LIT>'.format(url))<EOL>ret[url] = '<STR_LIT>'.format(i)<EOL>i += <NUM_LIT:1><EOL><DEDENT>return {p: u for u, p in ret.items()}<EOL>
_get_ns

        Low-level api: Return a dict of nsmap.

        Parameters
        ----------

        reply : `Element`
            rpc-reply as an instance of Element.

        Returns
        -------

        dict
            A dict of nsmap.