def _prefix_for_namespace(self, namespace):
        """Find the currently active prefix for the given namespace."""
        if namespace is None:
            return None
        for inverted_nsmap in reversed(self.nsmaps):
            if inverted_nsmap is not None and namespace in inverted_nsmap:
                return inverted_nsmap[namespace]
        return None
dataset/ETHPy150Open CouchPotato/CouchPotatoServer/libs/bs4/builder/_lxml.py/LXMLTreeBuilderForXML._prefix_for_namespace/original