Return the {@link NamespaceRegistry} associated with the arg session.

@param session containing the NamespaceRegistry
@return NamespaceRegistry
501930
public static NamespaceRegistry getNamespaceRegistry(final Session session) {
        try {
            return requireNonNull(session.getWorkspace().getNamespaceRegistry(),
                    "Couldn't find namespace registry in repository!");
        } catch (final RepositoryException e) {
            throw new RepositoryRuntimeException(e);
        }
    }
819757
String getEffectiveNamespace() {
    String namespace = Tenant.getNamespace();
    if (namespace == null) {
      namespace = datastore.getOptions().getNamespace();
    }
    return namespace;
  }
254906
public List<String> getHeapsForSession(IoSession session) {
        List<String> ret = new ArrayList<String>();
        try {
            subTermLock.lock();
            Multiset<String> s = heapsByClient.get(session);
            if (s != null) {
                ret.addAll(s.keySet());
            }
        } finally {
            subTermLock.unlock();
        }
        return ret;
    }
353115
def get_session(self, sid, namespace=None):
        
        return self.server.get_session(
            sid, namespace=namespace or self.namespace)
573937
@Override
    public final String getNamespaceURI(String prefix)
    {
        /* First the known offenders; invalid args, 2 predefined xml namespace
         * prefixes
         */
        if (prefix == null) {
            throw new IllegalArgumentException(ErrorConsts.ERR_NULL_ARG);
        }
        if (prefix.length() > 0) {
            if (prefix.equals(XMLConstants.XML_NS_PREFIX)) {
                return XMLConstants.XML_NS_URI;
            }
            if (prefix.equals(XMLConstants.XMLNS_ATTRIBUTE)) {
                return XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
            }
        }
        return doGetNamespaceURI(prefix);
    }
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;
	}
127050
public static String getPrefix(String namespaceString)
    {
        Namespace namespace = toNamespace(namespaceString);

        return namespace != null ? namespace.getType() : null;
    }
514660
private void unregisterNamespace(String prefix, boolean persist) throws NamespaceException, RepositoryException
   {
      if (namespaces.get(prefix) == null)
      {
         throw new NamespaceException("Prefix " + prefix + " is not registered");
      }

      if (PROTECTED_NAMESPACES.contains(prefix))
      {
         throw new NamespaceException("Prefix " + prefix + " is protected");
      }
      String uri = getURI(prefix);
      if (indexSearcherHolder != null)
      {
         final Set<String> nodes = indexSearcherHolder.getNodesByUri(uri);
         if (nodes.size() > 0)
         {
            StringBuilder builder = new StringBuilder();
            builder.append("Fail to unregister namespace '");
            builder.append(prefix);
            builder.append("' because of following nodes:  ");

            for (String uuid : nodes)
            {
               ItemData item = dataManager.getItemData(uuid);
               if (item != null && item.isNode())
               {
                  builder.append(" - ");
                  builder.append(item.getQPath().getAsString());
                  builder.append("\r\n");
               }
            }
            builder.append(" uses this prefix.");
            throw new NamespaceException(builder.toString());
         }
      }
      prefixes.remove(uri);
      namespaces.remove(prefix);
      if (persister != null && persist)
      {
         persister.removeNamespace(prefix);
      }
   }
142564
public static function &createWithName($name = null, AuraSession $session = null) : Session
    {
        $session = ! is_null($session) ? new static : new static($session);
        if (is_null($name)) {
            return $session;
        }

        $session->setSegmentName($name);
        return $session;
    }
1200890
@Override
    public final String getNamespaceURI(String prefix)
    {
        if (prefix == null) {
            throw new IllegalArgumentException(ErrorConsts.ERR_NULL_ARG);
        }
        if (prefix.length() == 0) {
            if (mDepth == 0) { // unexpected... but let's not err at this point
                /* 07-Sep-2007, TSa: Default/"no namespace" does map to
                 *    "URI" of empty String.
                 */
                return XmlConsts.DEFAULT_NAMESPACE_URI;
            }
            return mCurrElement.mDefaultNsURI;
        }
        if (prefix.equals(XMLConstants.XML_NS_PREFIX)) {
            return XMLConstants.XML_NS_URI;
        }
        if (prefix.equals(XMLConstants.XMLNS_ATTRIBUTE)) {
            return XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
        }
        /* Ok, need to find the match, if any; starting from end of the
         * list of active namespaces. Note that we can not count on prefix
         * being interned/canonicalized.
         */
        return mNamespaces.findLastNonInterned(prefix);
    }
319316
public static org.openbel.framework.common.model.Namespace convert(
            final Namespace ws) {
        return new org.openbel.framework.common.model.Namespace(
                ws.getPrefix(), ws.getResourceLocation());
    }
605434
protected function getSessionNamespace($name = null) {
		if ($name === null) {
			$name = str_replace('\\', '_', get_class($this));
		}
		
		if (isset($this->_namespacesInstances[$name])) {
			return $this->_namespacesInstances[$name];
		}
		
		$namespace = $this->getNamespaceFactory()->createNamespace($name);
		
		$this->_namespacesInstances[$name] = $namespace;
		return $namespace;
	}
665510
public Hashtable<String,List<Other>> attributesWithNamespace(String namespace) {


        Hashtable<String,List<Other>> result=namespaceIndex.get(namespace);
        if (result==null) {
            result=new Hashtable<String,List<Other>>();
            namespaceIndex.put(namespace,result);
        }

        for (Other attribute: attributes) {
            
            QualifiedName name=attribute.getElementName();
            if (namespace.equals(name.getNamespaceURI())) {
                List<Other> ll=result.get(name.getLocalPart());
                if (ll==null) {
                    List<Other> tmp=new LinkedList<Other>();
                    tmp.add(attribute);
                    result.put(name.getLocalPart(),tmp);
                } else {
                    ll.add(attribute);                        
                }
            }
        }
        return result;
    }
1121691
public String getNamespaceURI(String prefix)
   {
      String uri = null;
      try
      {
         uri = namespaceRegistry.getURI(prefix);
      }
      catch (NamespaceException exc)
      {
         uri = namespaces.get(prefix);
      }
      catch (RepositoryException exc)
      {
         log.error(exc.getMessage(), exc);
      }
      return uri;
   }
1320988
public String getNamespace(String ns)
      throws TimeoutException, InterruptedException, MemcachedException {
    String key = this.keyProvider.process(this.getNSKey(ns));
    byte[] keyBytes = ByteUtils.getBytes(key);
    ByteUtils.checkKey(keyBytes);
    Object item = this.fetch0(key, keyBytes, CommandType.GET_ONE, this.opTimeout, this.transcoder);
    while (item == null) {
      item = String.valueOf(System.nanoTime());
      boolean added = this.add0(key, 0, item, this.transcoder, this.opTimeout);
      if (!added) {
        item = this.fetch0(key, keyBytes, CommandType.GET_ONE, this.opTimeout, this.transcoder);
      }
    }
    String namespace = item.toString();
    if (!ByteUtils.isNumber(namespace)) {
      throw new IllegalStateException(
          "Namespace key already has value.The key is:" + key + ",and the value is:" + namespace);
    }
    return namespace;
  }
815331
@Override
    public String getNamespaceURI(String prefix){
        if(prefix==null)
            throw new IllegalArgumentException("prefix is null");

        return get(prefix);
    }
1223671
public MgcpEndpoint registerEndpoint(String namespace) throws UnrecognizedMgcpNamespaceException {
        // Get correct endpoint provider
        MgcpEndpointProvider<?> provider = this.providers.get(namespace);
        if (provider == null) {
            throw new UnrecognizedMgcpNamespaceException("Namespace " + namespace + " is unrecognized");
        }

        // Create the endpoint and register it
        MgcpEndpoint endpoint = provider.provide();
        endpoint.observe((MgcpEndpointObserver) this);
        endpoint.observe((MgcpMessageObserver) this);
        this.endpoints.put(endpoint.getEndpointId().toString(), endpoint);
        
        if (log.isDebugEnabled()) {
            log.debug("Registered endpoint " + endpoint.getEndpointId().toString() + ". Count: " + this.endpoints.size());
        }
        
        return endpoint;
    }