namespace_name : namespace_name NS_SEPARATOR STRING
                      | STRING
768317
def p_namespace_name(p):
    ''''''
    if len(p) == 4:
        p[0] = p[1] + p[2] + p[3]
    else:
        p[0] = p[1]
1078227
def _iparam_namespace_from_namespace(self, obj):
        # pylint: disable=invalid-name,
        

        if isinstance(obj, six.string_types):
            namespace = obj.strip('/')
        elif obj is None:
            namespace = obj
        else:
            raise TypeError(
                _format("The 'namespace' argument of the WBEMConnection "
                        "operation has invalid type {0} (must be None, or a "
                        "string)",
                        type(obj)))
        if namespace is None:
            namespace = self.default_namespace
        return namespace
1242480
def parse_namespace(parser, event, node):
    #pylint: disable=unused-argument
    
    name = _get_required_attribute(node, 'NAME')

    (next_event, next_node) = six.next(parser)

    if not _is_end(next_event, next_node, 'NAMESPACE'):
        raise ParseError('Expecting end NAMESPACE')

    return name
102287
def collection_names
      namespaces = self["system.namespaces"].find(name: { "$not" => /#{name}\.system\.|\$/ })
      namespaces.map do |doc|
        _name = doc["name"]
        _name[name.length + 1, _name.length]
      end
    end
579068
def namespace(self, value):
        
        if not isinstance(value, str):
            raise ValueError("Namespace must be a string")
        self._namespace = value
1127530
def filter_alias_create_namespace(namespace):
    
    def filter_string(s):
        return ' '.join(s.strip().split())

    namespace.alias_name = filter_string(namespace.alias_name)
    namespace.alias_command = filter_string(namespace.alias_command)
    return namespace
390850
def namespace_uri(self):
        
        try:
            return next(
                iter(filter(lambda uri: URI(uri).namespace, self._uri))
            )
        except StopIteration:
            return None
182915
function parseClassName(fullClassName, namespaces) {
		const result = {};
		let className = fullClassName;
		// Extract the namespace
		if (namespaces.length) {
			const namespaceIndex = namespaces.findIndex((namespace) => {
				return className.startsWith(namespace);
			});
			if (namespaceIndex === -1) {
				return result;
			}
			const namespace = namespaces[namespaceIndex];
			result.namespace = namespace;
			className = className.substr(namespace.length);
		}
		// Handle className with helper prefixes
		const helperPrefix = className.split('-')[0];
		if (validHelperPrefixes.indexOf(helperPrefix) !== -1) {
			result.helper = helperPrefix;
			className = className.substr(helperPrefix.length + 1);
		}
		// Handle classNames with prefixes
		const patternPrefix = className.split('-')[0];
		if (validPatternPrefixes.indexOf(patternPrefix) !== -1) {
			result.pattern = patternPrefix;
			className = className.substr(patternPrefix.length + 1);
		}
		result.name = className;
		result.parts = className.split(/__|--/);
		return result;
	}
1123516
def has_regex_namespace_name(self, namespace: str, name: str) -> bool:
        """"""
        return self.has_regex_namespace(namespace) and self.namespace_to_pattern[namespace].match(name)
346142
def namespace(self, prefix=None):
        
        ns = self.schema.tns
        if ns[0] is None:
            ns = (prefix, ns[1])
        return ns
437013
def write_namespaces(self, namespaces):
        """"""
        self.printer.writelines(
            "def _mako_get_namespace(context, name):",
                "try:",
                    "return context.namespaces[(__name__, name)]",
                "except KeyError:",
                    "_mako_generate_namespaces(context)",
                "return context.namespaces[(__name__, name)]",
            None, None
        )
        self.printer.writeline("def _mako_generate_namespaces(context):")


        for node in namespaces.values():
            if 'import' in node.attributes:
                self.compiler.has_ns_imports = True
            self.printer.start_source(node.lineno)
            if len(node.nodes):
                self.printer.writeline("def make_namespace():")
                export = []
                identifiers = self.compiler.identifiers.branch(node)
                self.in_def = True
                class NSDefVisitor(object):
                    def visitDefTag(s, node):
                        s.visitDefOrBase(node)

                    def visitBlockTag(s, node):
                        s.visitDefOrBase(node)

                    def visitDefOrBase(s, node):
                        if node.is_anonymous:
                            raise exceptions.CompileException(
                                "Can't put anonymous blocks inside "
                                "<%namespace>",
                                **node.exception_kwargs
                            )
                        self.write_inline_def(node, identifiers, nested=False)
                        export.append(node.funcname)
                vis = NSDefVisitor()
                for n in node.nodes:
                    n.accept_visitor(vis)
                self.printer.writeline("return [%s]" % (','.join(export)))
                self.printer.writeline(None)
                self.in_def = False
                callable_name = "make_namespace()"
            else:
                callable_name = "None"

            if 'file' in node.parsed_attributes:
                self.printer.writeline(
                                "ns = runtime.TemplateNamespace(%r,"
                                " context._clean_inheritance_tokens(),"
                                " templateuri=%s, callables=%s, "
                                " calling_uri=_template_uri)" %
                                (
                                    node.name,
                                    node.parsed_attributes.get('file', 'None'),
                                    callable_name,
                                )
                            )
            elif 'module' in node.parsed_attributes:
                self.printer.writeline(
                                "ns = runtime.ModuleNamespace(%r,"
                                " context._clean_inheritance_tokens(),"
                                " callables=%s, calling_uri=_template_uri,"
                                " module=%s)" %
                                (
                                    node.name,
                                    callable_name,
                                    node.parsed_attributes.get(
                                                'module', 'None')
                                )
                            )
            else:
                self.printer.writeline(
                                "ns = runtime.Namespace(%r,"
                                " context._clean_inheritance_tokens(),"
                                " callables=%s, calling_uri=_template_uri)" %
                                (
                                    node.name,
                                    callable_name,
                                )
                            )
            if eval(node.attributes.get('inheritable', "False")):
                self.printer.writeline("context['self'].%s = ns" % (node.name))

            self.printer.writeline(
                "context.namespaces[(__name__, %s)] = ns" % repr(node.name))
            self.printer.write_blanks(1)
        if not len(namespaces):
            self.printer.writeline("pass")
        self.printer.writeline(None)
64181
def expand_namespace(nsmap, string):
    
    for ns in nsmap:
        if isinstance(string, str) and isinstance(ns, str) and string.startswith(ns+":"):
            return string.replace(ns+":", nsmap[ns])
    return string
2532
def namespace(self):
        
        if self.m_name == -1 or (self.m_event != const.START_TAG and self.m_event != const.END_TAG):
            return u''

        # No Namespace
        if self.m_namespaceUri == 0xFFFFFFFF:
            return u''

        return self.sb[self.m_namespaceUri]
315276
def has_namespace_name(self, line: str, position: int, namespace: str, name: str) -> bool:
        """"""
        self.raise_for_missing_namespace(line, position, namespace, name)
        return self.has_enumerated_namespace_name(namespace, name) or self.has_regex_namespace_name(namespace, name)
12314
def resolve_namespace(self, qname):
        
        if ':' in qname:
            prefix, name = qname.split(':', 1)
            uri = self._ns[prefix]
        else:
            name = qname
            if None in self._ns:
                uri = self._ns[None]
            else:
                uri = None
        return (uri, name)
204315
def namedb_get_all_namespace_ids( cur ):
    

    query = "SELECT namespace_id FROM namespaces WHERE op = ?;"
    args = (NAMESPACE_READY,)

    namespace_rows = namedb_query_execute( cur, query, args )
    ret = []
    for namespace_row in namespace_rows:
        ret.append( namespace_row['namespace_id'] )

    return ret
1060752
private String getNamespaceDeclarations() {
        StringBuilder nsDecls = new StringBuilder();
        String quoteStyle = "'";
        for (Iterator keys = ctx.getPrefixes(); keys.hasNext(); ) {
            String prefix = (String) keys.next();
            String uri = ctx.getNamespaceURI(prefix);
            if (uri == null) {
                continue;
            }
            // this shouldn't have happened, but better safe than sorry
            if (prefix == null) {
                prefix = "";
            }

            if (uri.indexOf('\'') != -1) {
                quoteStyle = "\"";
            }
            nsDecls.append(' ').append(XMLNS_PREFIX);
            if (prefix.length() > 0) {
                nsDecls.append(':');
            }
            nsDecls.append(prefix).append('=')
                .append(quoteStyle).append(uri).append(quoteStyle)
                .append(' ');
        }
        return nsDecls.toString();
    }