#NEWLINE# def get_namespace( self , uri ) : #NEWLINE# #INDENT# "Return a :class:`.Namespace` corresponding to the given ``uri``.\n\n        If the given ``uri`` is a relative URI (i.e. it does not\n        contain a leading slash ``/``), the ``uri`` is adjusted to\n        be relative to the ``uri`` of the namespace itself. This\n        method is therefore mostly useful off of the built-in\n        ``local`` namespace, described in :ref:`namespace_local`.\n\n        In\n        most cases, a template wouldn't need this function, and\n        should instead use the ``<%namespace>`` tag to load\n        namespaces. However, since all ``<%namespace>`` tags are\n        evaluated before the body of a template ever runs,\n        this method can be used to locate namespaces using\n        expressions that were generated within the body code of\n        the template, or to conditionally use a particular\n        namespace.\n\n        " #NEWLINE# key = ( self , uri ) #NEWLINE# if ( key in self . context . namespaces ) : #NEWLINE# #INDENT# return self . context . namespaces [ key ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ns = TemplateNamespace ( uri , self . context . _copy ( ) , templateuri = ns , calling_uri = self . _templateuri ) #NEWLINE# self . context . namespaces [ key ] = ns #NEWLINE# return ns