_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.

def _get_ns(self, reply):
        '''_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.
        '''

        def get_prefix(url):
            if url in special_prefixes:
                return special_prefixes[url]
            for i in self.namespaces:
                if url == i[2]:
                    return i[1]
            return None

        root = reply.getroottree()
        urls = set()
        for node in root.iter():
            urls.update([u for p, u in node.nsmap.items()])
        ret = {url: get_prefix(url) for url in urls}
        i = 0
        for url in [url for url in ret if ret[url] is None]:
            logger.warning('{} cannot be found in namespaces of any ' \
                           'models'.format(url))
            ret[url] = 'ns{:02d}'.format(i)
            i += 1
        return {p: u for u, p in ret.items()}