code: def getprefix(self, u):
          
          for ns in Namespace.all:
              if u == ns[1]:
                  return ns[0]
          for ns in self.prefixes:
              if u == ns[1]:
                  return ns[0]
          raise Exception('ns (%s) not mapped' % u)
docs: Get the prefix for the specified namespace (uri)
          @param u: A namespace uri.
          @type u: str
          @return: The namspace.
          @rtype: (prefix, uri).