Convert an input value into the internally used values of
        this object

        @param namespace: The string or constant to convert
        @type namespace: str or unicode or BARE_NS or OPENID_NS
434404
def _fixNS(self, namespace):
        
        if namespace == OPENID_NS:
            if self._openid_ns_uri is None:
                raise UndefinedOpenIDNamespace('OpenID namespace not set')
            else:
                namespace = self._openid_ns_uri

        if namespace != BARE_NS and type(namespace) not in [str, unicode]:
            raise TypeError(
                "Namespace must be BARE_NS, OPENID_NS or a string. got %r"
                % (namespace,))

        if namespace != BARE_NS and ':' not in namespace:
            fmt = 'OpenID 2.0 namespace identifiers SHOULD be URIs. Got %r'
            warnings.warn(fmt % (namespace,), DeprecationWarning)

            if namespace == 'sreg':
                fmt = 'Using %r instead of "sreg" as namespace'
                warnings.warn(fmt % (SREG_URI,), DeprecationWarning,)
                return SREG_URI

        return namespace
620374
def _parseAtNamespace(self, src):
        

        src = self._parseSCDOCDC(src)
        while isAtRuleIdent(src, 'namespace'):
            ctxsrc = src
            src = stripAtRuleIdent(src)

            namespace, src = self._getStringOrURI(src)
            if namespace is None:
                nsPrefix, src = self._getIdent(src)
                if nsPrefix is None:
                    raise self.ParseError('@namespace expected an identifier or a URI', src, ctxsrc)
                namespace, src = self._getStringOrURI(src.lstrip())
                if namespace is None:
                    raise self.ParseError('@namespace expected a URI', src, ctxsrc)
            else:
                nsPrefix = None

            src = src.lstrip()
            if src[:1] != ';':
                raise self.ParseError('@namespace expected a terminating \';\'', src, ctxsrc)
            src = src[1:].lstrip()

            self.cssBuilder.atNamespace(nsPrefix, namespace)

            src = self._parseSCDOCDC(src)
        return src
305634
def namespace=(a_namespace)
      a_namespace = a_namespace.to_s
      SDL4R.validate_identifier(a_namespace) unless a_namespace.empty?
      @namespace = a_namespace
    end
240283
def _generate_namespace():
        
        raw_namespace = None

        # Get the Jupyter user, if available
        try:
            raw_namespace = os.environ['JPY_USER']
        except KeyError:
            pass

        # Otherwise get the current user
        if raw_namespace is None or raw_namespace == '':
            raw_namespace = getpass.getuser()

        # Remove illegal characters and return
        return re.sub(r'[^\w.-]', '-', raw_namespace)
149317
def handle_namespace_lenient(line: str, position: int, tokens: ParseResults) -> ParseResults:
        """"""
        tokens[NAMESPACE] = DIRTY
        log.debug('Naked namespace: [%d] %s', position, line)
        return tokens
1051396
function namespace(ns) {
  var names = ns.split('.');
  var owner = window;
  for (var i = 0; i < names.length; i++) {
    var name = names[i];
    owner[name] = owner[name] || {};
    owner = owner[name];
  }
  return owner;
}
959457
def price_namespace( namespace_id, block_height, units ):
    
    price_table = get_epoch_namespace_prices( block_height, units )
    if price_table is None:
        return None

    if len(namespace_id) >= len(price_table) or len(namespace_id) == 0:
        return None

    return price_table[len(namespace_id)]
932822
function (namespace) {
			var result,
				aNamespaceParts = namespace.split(".");

			if (aNamespaceParts[0] === "Org" && aNamespaceParts[1] === "OData") {
				result = '<a href="' + this.ANNOTATIONS_NAMESPACE_LINK + namespace + '.xml">' + namespace + '</a>';
			} else {
				result = namespace;
			}

			result = this._preProcessLinksInTextBlock(result);
			return result;
		}
21798
def add_token_to_namespace(self, token: str, namespace: str = 'tokens') -> int:
        
        if not isinstance(token, str):
            raise ValueError("Vocabulary tokens must be strings, or saving and loading will break."
                             "  Got %s (with type %s)" % (repr(token), type(token)))
        if token not in self._token_to_index[namespace]:
            index = len(self._token_to_index[namespace])
            self._token_to_index[namespace][token] = index
            self._index_to_token[namespace][index] = token
            return index
        else:
            return self._token_to_index[namespace][token]
1066886
public final BELScriptParser.define_namespace_return define_namespace() throws RecognitionException {
        BELScriptParser.define_namespace_return retval = new BELScriptParser.define_namespace_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token string_literal33=null;
        Token string_literal34=null;
        Token string_literal35=null;
        Token OBJECT_IDENT36=null;
        Token string_literal37=null;
        Token string_literal38=null;
        BELScriptParser.quoted_value_return quoted_value39 = null;


        Object string_literal33_tree=null;
        Object string_literal34_tree=null;
        Object string_literal35_tree=null;
        Object OBJECT_IDENT36_tree=null;
        Object string_literal37_tree=null;
        Object string_literal38_tree=null;

         paraphrases.push("in define namespace."); 
        try {
            // BELScript.g:98:5: ( ( 'DEFINE' ( ( 'DEFAULT' )? 'NAMESPACE' ) ) OBJECT_IDENT 'AS' 'URL' quoted_value )
            // BELScript.g:99:5: ( 'DEFINE' ( ( 'DEFAULT' )? 'NAMESPACE' ) ) OBJECT_IDENT 'AS' 'URL' quoted_value
            {
            root_0 = (Object)adaptor.nil();

            // BELScript.g:99:5: ( 'DEFINE' ( ( 'DEFAULT' )? 'NAMESPACE' ) )
            // BELScript.g:99:6: 'DEFINE' ( ( 'DEFAULT' )? 'NAMESPACE' )
            {
            string_literal33=(Token)match(input,27,FOLLOW_27_in_define_namespace429); 
            string_literal33_tree = (Object)adaptor.create(string_literal33);
            adaptor.addChild(root_0, string_literal33_tree);

            // BELScript.g:99:15: ( ( 'DEFAULT' )? 'NAMESPACE' )
            // BELScript.g:99:16: ( 'DEFAULT' )? 'NAMESPACE'
            {
            // BELScript.g:99:16: ( 'DEFAULT' )?
            int alt6=2;
            int LA6_0 = input.LA(1);

            if ( (LA6_0==28) ) {
                alt6=1;
            }
            switch (alt6) {
                case 1 :
                    // BELScript.g:99:17: 'DEFAULT'
                    {
                    string_literal34=(Token)match(input,28,FOLLOW_28_in_define_namespace433); 
                    string_literal34_tree = (Object)adaptor.create(string_literal34);
                    adaptor.addChild(root_0, string_literal34_tree);


                    }
                    break;

            }

            string_literal35=(Token)match(input,29,FOLLOW_29_in_define_namespace437); 
            string_literal35_tree = (Object)adaptor.create(string_literal35);
            adaptor.addChild(root_0, string_literal35_tree);


            }


            }

            OBJECT_IDENT36=(Token)match(input,OBJECT_IDENT,FOLLOW_OBJECT_IDENT_in_define_namespace441); 
            OBJECT_IDENT36_tree = (Object)adaptor.create(OBJECT_IDENT36);
            adaptor.addChild(root_0, OBJECT_IDENT36_tree);

            string_literal37=(Token)match(input,30,FOLLOW_30_in_define_namespace443); 
            string_literal37_tree = (Object)adaptor.create(string_literal37);
            adaptor.addChild(root_0, string_literal37_tree);

            string_literal38=(Token)match(input,31,FOLLOW_31_in_define_namespace445); 
            string_literal38_tree = (Object)adaptor.create(string_literal38);
            adaptor.addChild(root_0, string_literal38_tree);

            pushFollow(FOLLOW_quoted_value_in_define_namespace447);
            quoted_value39=quoted_value();

            state._fsp--;

            adaptor.addChild(root_0, quoted_value39.getTree());

            }

            retval.stop = input.LT(-1);

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

             paraphrases.pop(); 
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
441778
def handle_namespace_pattern(self, line: str, position: int, tokens: ParseResults) -> ParseResults:
        
        namespace = tokens['name']
        self.raise_for_redefined_namespace(line, position, namespace)
        self.namespace_to_pattern[namespace] = re.compile(tokens['value'])
        return tokens
1178040
def _validate_namespace(self, namespace):
        
        # Update config values (so other code can access them in the bootstrap phase)
        self._update_config(namespace)

        # Validate announce URLs
        for key, val in namespace["announce"].items():
            if isinstance(val, basestring):
                namespace["announce"][key] = val.split()

        # Re-escape output formats
        self._interpolation_escape(namespace["formats"])

        # Create objects from module specs
        for factory in ("engine",):
            if isinstance(namespace[factory], basestring):
                namespace[factory] = pymagic.import_name(namespace[factory])() if namespace[factory] else None

        # Do some standard type conversions
        for key in namespace:
            # Split lists
            if key.endswith("_list") and isinstance(namespace[key], basestring):
                namespace[key] = [i.strip() for i in namespace[key].replace(',', ' ').split()]

            # Resolve factory and callback handler lists
            elif any(key.endswith(i) for i in ("_factories", "_callbacks")) and isinstance(namespace[key], basestring):
                namespace[key] = [pymagic.import_name(i.strip()) for i in namespace[key].replace(',', ' ').split()]

        # Update config values again
        self._update_config(namespace)
661280
def _namespace_ready(self, namespace):
        
        try:
            secrets = self.core_api.list_namespaced_secret(namespace=namespace)
            if len(secrets.items) > 0:
                # API tokens for service accounts are generated
                logger.info("Namespace is ready!")
                return True
        except ApiException as e:
            raise ConuException(
                "Exception when calling Kubernetes API %s\n" % e)

        return False
1142170
public final void nameSpace (String namespace) {
    if (namespace == null || namespace.equals("")) {
      _namespace = "";
    } else {
      _namespace = namespace + ":";
    }
  }
188411
def addAlias(self, namespace_uri, desired_alias, implicit=False):
        
        if isinstance(namespace_uri, bytes):
            namespace_uri = str(namespace_uri, encoding="utf-8")
        # Check that desired_alias is not an openid protocol field as
        # per the spec.
        assert desired_alias not in OPENID_PROTOCOL_FIELDS, \
               "%r is not an allowed namespace alias" % (desired_alias,)

        # Check that desired_alias does not contain a period as per
        # the spec.
        if isinstance(desired_alias, str):
            assert '.' not in desired_alias, \
                   "%r must not contain a dot" % (desired_alias,)

        # Check that there is not a namespace already defined for
        # the desired alias
        current_namespace_uri = self.alias_to_namespace.get(desired_alias)
        if (current_namespace_uri is not None and
                current_namespace_uri != namespace_uri):

            fmt = ('Cannot map %r to alias %r. '
                   '%r is already mapped to alias %r')

            msg = fmt % (namespace_uri, desired_alias, current_namespace_uri,
                         desired_alias)
            raise KeyError(msg)

        # Check that there is not already a (different) alias for
        # this namespace URI
        alias = self.namespace_to_alias.get(namespace_uri)
        if alias is not None and alias != desired_alias:
            fmt = ('Cannot map %r to alias %r. '
                   'It is already mapped to alias %r')
            raise KeyError(fmt % (namespace_uri, desired_alias, alias))

        assert (desired_alias == NULL_NAMESPACE or
                type(desired_alias) in [str, str]), repr(desired_alias)
        assert namespace_uri not in self.implicit_namespaces
        self.alias_to_namespace[desired_alias] = namespace_uri
        self.namespace_to_alias[namespace_uri] = desired_alias
        if implicit:
            self.implicit_namespaces.append(namespace_uri)
        return desired_alias
826075
private String getNamespaceValue(final String value) {
        if (value == null || value.contains(":") || value.equals("text")) {
            return value;
        } else {
            return getCurrentNamespace() + ":" + value;
        }
    }
561006
public String childValue(String name, String namespace) {
        for (XNElement e : children) {
            if (Objects.equals(e.name, name) && Objects.equals(e.namespace, namespace)) {
                return e.content;
            }
        }
        return null;
    }