Returns the namespace mapped to the specified prefix.

@param prefix the prefix lookup
@return the namespace of the prefix
517516
public String lookupNamespace(final String prefix) {
        Object namespace = namespaceMap.get(prefix);
        if (namespace != null) {
            return namespace.toString();
        }
        return this.namespaceTagHints.isEmpty() ? prefix : this.namespaceTagHints.get(prefix);
    }
75269
function getNamespaceFromPrefix($prefix){
		if (isset($this->namespaces[$prefix])) {
			return $this->namespaces[$prefix];
		}
		//$this->setError("No namespace registered for prefix '$prefix'");
		return false;
	}
915822
public Properties getSubProperties (String prefix)
    {
        Properties props = new Properties();
        getSubProperties(prefix, props);
        return props;
    }
276431
private function getNamespace($prefix)
    {
        $namespaces = $this->getExtensions()->getNamespaces();
        if (!array_key_exists($prefix, $namespaces)) {
            throw new \InvalidArgumentException(sprintf('Unknown NS prefix "%s"', $prefix));
        }

        return $namespaces[$prefix];
    }
454221
def namespaces(*prefixes):
    
    namespaces = {}
    for prefix in prefixes:
        namespaces[prefix] = _nsmap[prefix]
    return namespaces
642101
public String getNamespaceURI(String prefix) {
		List<NamespaceDeclaration> nsDecls = getNamespaceDeclarations();
		for (int i = 0; i < nsDecls.size(); i++) {
			NamespaceDeclaration nsDecl = nsDecls.get(i);
			if (nsDecl.prefix.equals(prefix)) {
				return nsDecl.namespaceURI;
			}
		}
		return null;
	}
1135984
public static Map<String, String> getNamespaces(final Session session) {
        final NamespaceRegistry registry = getNamespaceRegistry(session);
        final Map<String, String> namespaces = new HashMap<>();

        try {
            stream(registry.getPrefixes()).filter(internalPrefix.negate()).forEach(x -> {
                try {
                    namespaces.put(x, registry.getURI(x));
                } catch (final RepositoryException e) {
                    throw new RepositoryRuntimeException(e);
                }
            });
        } catch (final RepositoryException e) {
            throw new RepositoryRuntimeException(e);
        }
        return namespaces;
    }
112558
public void registerPrefixForNamespace(String prefix, String namespace) {
        getEnvironment().registerNamespace(prefix, getUrl(namespace));
    }
838628
public String getNamespacePrefix(final PrefixMapping mapping,
            final String ns, final boolean compact) {
        final String nsURIPrefix = mapping.getNsURIPrefix(ns);
        if (nsURIPrefix == null) {
            if (compact) {
                final int hashIdx = ns.lastIndexOf('#');
                final int split = hashIdx > 0 ? ns.substring(0, hashIdx).lastIndexOf('/') : ns.lastIndexOf('/');
                return split > 0 ? "..." + ns.substring(split) : ns;
            }
            return ns;
        }
        return nsURIPrefix + ":";
    }
377683
public static String add(String prefix, String name) {
    return (prefix == null) ? name : prefix+"."+name;
  }
865720
public String findUriByPrefix(String prefix)
    {
        /* This is quite simple: just need to locate the last mapping
         * for the prefix, if any:
         */
        String[] strs = mNsStrings;
        int phash = prefix.hashCode();

        for (int ix = mScopeEnd - 2; ix >= 0; ix -= 2) {
            String thisP = strs[ix];
            if (thisP == prefix ||
                (thisP.hashCode() == phash && thisP.equals(prefix))) {
                return strs[ix+1];
            }
        }
        return null;
    }
1337617
protected boolean popNamespace(String prefix)
    {
        try
        {
            if (m_prefixMap.popNamespace(prefix))
            {
                m_saxHandler.endPrefixMapping(prefix);
                return true;
            }
        }
        catch (SAXException e)
        {
            // falls through
        }
        return false;
    }
127050
public static String getPrefix(String namespaceString)
    {
        Namespace namespace = toNamespace(namespaceString);

        return namespace != null ? namespace.getType() : null;
    }
85542
public String getNameSpace() {
        if (nameSpace == null) {
            nameSpace = new StringBuilder().append(catalog).append(".").append(table).toString();
        }
        return nameSpace;

    }
413108
public static String createRandomName(String prefix) {
		Preconditions.checkNotNull(prefix, "Prefix must not be null.");

		long nameOffset;

		// obtain the next name offset by incrementing it atomically
		do {
			nameOffset = nextNameOffset.get();
		} while (!nextNameOffset.compareAndSet(nameOffset, nameOffset + 1L));

		return prefix + '_' + nameOffset;
	}
950406
public function get_namespace($name = null)
    {
        $ns = $this->namespace;

        if ($name) {
            // an alias for BC
            if ($name == 'prefix') {
                $name = 'prefix_in';
            }

            return isset($ns[$name]) ? $ns[$name] : null;
        }

        unset($ns['prefix_in'], $ns['prefix_out']);

        return $ns;
    }
942796
def namespace(self):
        
        if self.prefix is None:
            return Namespace.default
        else:
            return self.resolvePrefix(self.prefix)