'Given a plain target namespace, return the corresponding source
namespace.'

def unmap_namespace(self, plain_target_ns):

    if ((not self._regex_map) and (not self._plain)):
        return plain_target_ns
    src_name_set = self._reverse_plain.get(plain_target_ns)
    if src_name_set:
        for src_name in src_name_set:
            return src_name
    for (_, namespace) in self._regex_map:
        original_name = match_replace_regex(namespace_to_regex(namespace.dest_name), plain_target_ns, namespace.source_name)
        if original_name:
            return original_name
    return None
