static_scalar : namespace_name
                     | NS_SEPARATOR namespace_name
                     | NAMESPACE NS_SEPARATOR namespace_name
333765
def p_static_scalar_namespace_name(p):
    ''''''
    if len(p) == 2:
        p[0] = ast.Constant(p[1], lineno=p.lineno(1))
    elif len(p) == 3:
        p[0] = ast.Constant(p[1] + p[2], lineno=p.lineno(1))
    else:
        p[0] = ast.Constant(p[1] + p[2] + p[3], lineno=p.lineno(1))
843318
def prefixed_to_namespaced(C, prefixed_name, namespaces):
        
        if ':' not in prefixed_name:
            return prefixed_name
        else:
            prefix, name = prefixed_name.split(':')
            namespace = namespaces[prefix]
            return "{%s}%s" % (namespace, name)
1288824
def _parse_scalars(scalars):
        
        scalar_dict = {}

        # Scalars are defined in a fixed two-level hierarchy within the definition file.
        # The first level contains the category name, while the second level contains the
        # probe name (e.g. "category.name: probe: ...").
        for category_name in scalars:
            category = scalars[category_name]

            for probe_name in category:
                # We found a scalar type. Go ahead and parse it.
                scalar_definition = category[probe_name]
                # We pass |strict_type_checks=False| as we don't want to do any check
                # server side. This includes skipping the checks for the required keys.
                scalar_info = ScalarType(category_name, probe_name, scalar_definition,
                                         strict_type_checks=False)
                scalar_dict[scalar_info.label] = scalar_info

        return scalar_dict
183477
def namespaces ns = "root", cn = "__Namespace"
    result = []
    each_instance( ns, cn ) do |inst|
      name = "#{ns}/#{inst.Name}"
      result << name
      result.concat namespaces name, cn
    end
    result.uniq
  end
664996
function XName(name) {
        if (TypeUtils.isNullOrUndefined(name)) {
            throw "Name cannot be (null) or (undefined)!";
        }
        name = ('' + name).trim();
        var ns = null;
        var ln = name;
        if (ln.indexOf(':') > -1) {
            var parts = ln.split(':');
            if (2 !== parts.length) {
                throw "Cannot have more than one separator!";
            }
            ns = parts[0].trim();
            ln = parts[1].trim();
        }
        if ('' === ln) {
            throw "Local name cannot be empty!";
        }
        if (null !== ns) {
            ns = ns.trim();
            if ('' === ns) {
                ns = null;
            }
        }
        this._namespace = ns;
        this._localName = ln;
    }
115433
static function __static()
	{
		XmlTokenizedType::$typeToCodeMap = array(
			'xs:string'					=> XmlTokenizedType::None,
			'xs:boolean'				=> XmlTokenizedType::None,
			'xs:decimal'				=> XmlTokenizedType::None,
			'xs:double'					=> XmlTokenizedType::None,
			'xs:float'					=> XmlTokenizedType::None,
			'xs:duration'				=> XmlTokenizedType::None,
			'xs:dateTime'				=> XmlTokenizedType::None,
			'xs:time'					=> XmlTokenizedType::None,
			'xs:date'					=> XmlTokenizedType::None,
			'xs:gYearMonth'				=> XmlTokenizedType::None,
			'xs:gYear'					=> XmlTokenizedType::None,
			'xs:gMonthDay'				=> XmlTokenizedType::None,
			'xs:gDay'					=> XmlTokenizedType::None,
			'xs:gMonth'					=> XmlTokenizedType::None,
			'xs:hexBinary'				=> XmlTokenizedType::None,
			'xs:base64Binary'			=> XmlTokenizedType::None,
			'xs:anyURI'					=> XmlTokenizedType::None,
			'xs:QName'					=> XmlTokenizedType::None,
			'xs:NOTATION'				=> XmlTokenizedType::NOTATION,
			'xs:normalizedString'		=> XmlTokenizedType::None,
			'xs:token'					=> XmlTokenizedType::None,
			'xs:language'				=> XmlTokenizedType::None,
			'xs:name'					=> XmlTokenizedType::None,
			'xs:NCName'					=> XmlTokenizedType::NCName,
			'xs:NMTOKEN'				=> XmlTokenizedType::NMTOKEN,
			'xs:ID'						=> XmlTokenizedType::ID,
			'xs:IDREF'					=> XmlTokenizedType::IDREF,
			'xs:ENTITY'					=> XmlTokenizedType::ENTITY,
			'xs:integer'				=> XmlTokenizedType::None,
			'xs:nonPositiveInteger'		=> XmlTokenizedType::None,
			'xs:long'					=> XmlTokenizedType::None,
			'xs:nonNegativeInteger'		=> XmlTokenizedType::None,
			'xs:negativeInteger' 		=> XmlTokenizedType::None,
			'xs:int'					=> XmlTokenizedType::None,
			'xs:short'					=> XmlTokenizedType::None,
			'xs:byte'					=> XmlTokenizedType::None,
			'xs:positiveInteger' 		=> XmlTokenizedType::None,
			'xs:unsignedLong' 			=> XmlTokenizedType::None,
			'xs:unsignedInt' 			=> XmlTokenizedType::None,
			'xs:unsignedShort'			=> XmlTokenizedType::None,
			'xs:unsignedByte'			=> XmlTokenizedType::None,
			'xs:IDREFS'					=> XmlTokenizedType::IDREFS,
			'xs:ENTITIES'				=> XmlTokenizedType::ENTITIES,
			'xs:NMTOKENS'				=> XmlTokenizedType::NMTOKENS,
			'xsd:string'				=> XmlTokenizedType::None,
			'xsd:boolean'				=> XmlTokenizedType::None,
			'xsd:decimal'				=> XmlTokenizedType::None,
			'xsd:double'				=> XmlTokenizedType::None,
			'xsd:float'					=> XmlTokenizedType::None,
			'xsd:duration'				=> XmlTokenizedType::None,
			'xsd:dateTime'				=> XmlTokenizedType::None,
			'xsd:time'					=> XmlTokenizedType::None,
			'xsd:date'					=> XmlTokenizedType::None,
			'xsd:gYearMonth'			=> XmlTokenizedType::None,
			'xsd:gYear'					=> XmlTokenizedType::None,
			'xsd:gMonthDay'				=> XmlTokenizedType::None,
			'xsd:gDay'					=> XmlTokenizedType::None,
			'xsd:gMonth'				=> XmlTokenizedType::None,
			'xsd:hexBinary'				=> XmlTokenizedType::None,
			'xsd:base64Binary'			=> XmlTokenizedType::None,
			'xsd:anyURI'				=> XmlTokenizedType::None,
			'xsd:QName'					=> XmlTokenizedType::None,
			'xsd:NOTATION'				=> XmlTokenizedType::NOTATION,
			'xsd:normalizedString'		=> XmlTokenizedType::None,
			'xsd:token'					=> XmlTokenizedType::None,
			'xsd:language'				=> XmlTokenizedType::None,
			'xsd:name'					=> XmlTokenizedType::None,
			'xsd:NCName'				=> XmlTokenizedType::NCName,
			'xsd:NMTOKEN'				=> XmlTokenizedType::NMTOKEN,
			'xsd:ID'					=> XmlTokenizedType::ID,
			'xsd:IDREF'					=> XmlTokenizedType::IDREF,
			'xsd:ENTITY'				=> XmlTokenizedType::ENTITY,
			'xsd:integer'				=> XmlTokenizedType::None,
			'xsd:nonPositiveInteger'	=> XmlTokenizedType::None,
			'xsd:long'					=> XmlTokenizedType::None,
			'xsd:nonNegativeInteger'	=> XmlTokenizedType::None,
			'xsd:negativeInteger' 		=> XmlTokenizedType::None,
			'xsd:int'					=> XmlTokenizedType::None,
			'xsd:short'					=> XmlTokenizedType::None,
			'xsd:byte'					=> XmlTokenizedType::None,
			'xsd:positiveInteger' 		=> XmlTokenizedType::None,
			'xsd:unsignedLong' 			=> XmlTokenizedType::None,
			'xsd:unsignedInt' 			=> XmlTokenizedType::None,
			'xsd:unsignedShort'			=> XmlTokenizedType::None,
			'xsd:unsignedByte'			=> XmlTokenizedType::None,
			'xsd:IDREFS'				=> XmlTokenizedType::IDREFS,
			'xsd:ENTITIES'				=> XmlTokenizedType::ENTITIES,
			'xsd:NMTOKENS'				=> XmlTokenizedType::NMTOKENS,
		);
	}
463442
def parse_namespacepath(parser, event, node): #pylint: disable=unused-argument
    


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

    if not _is_start(next_event, next_node, 'HOST'):
        raise ParseError('Expecting HOST')

    host = parse_host(parser, next_event, next_node)

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

    if not _is_start(next_event, next_node, 'LOCALNAMESPACEPATH'):
        raise ParseError('Expecting LOCALNAMESPACEPATH')

    namespacepath = parse_localnamespacepath(parser, next_event, next_node)

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

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

    return (host, namespacepath)
295325
def namespace(self):
        """"""
        if not self._operation_calculated:
            self._operation_calculated = True
            self._extract_operation_and_namespace()

        return self._namespace
1088150
def merge_namespace_bindings(ns1, ns2)
      m = ns1.clone
      ns2.each do |k,v|
        raise "bindings clash: '#{k}'=>'#{m[k]}' , '#{k}'=>'#{v}'" if m.has_key?(k) && m[k]!=v
        m[k]=v
      end
      m
    end
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;
	}
865039
def namespace(self, key, glob=False):
        """"""
        if not self.name:
            self.name = os.environ['DJANGO_SETTINGS_MODULE'] 
        ns = '.'.join([key, self._glob]) if glob else '.'.join([self.name, self._glob])
        return ns
92970
def _cls_fqn(self, cls):
        
        ns = self._namespace_stack[-1]
        if ns in ['__base__', None]:
            return cls.__name__
        else:
            return ns + '.' + cls.__name__
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
789261
def _descend_namespace(caller_globals, name):
    
    names =  name.split('.')
    cur = caller_globals
    for i in names:
        if type(cur) is dict:
            cur = cur[i]
        else:
            cur = getattr(cur, i)
    return cur
116497
def ns_format(element, namespaced_string):
    
    if ':' not in namespaced_string:
        print('This name contains no namespace, returning it unmodified: ' + namespaced_string)
        return namespaced_string
    namespace, name = namespaced_string.split(':')
    return '{' + element.nsmap[namespace] + '}' + name
221017
public static function __static()
	{
		SchemaTypes::$nameStartChar = "[:_\.\p{Ll}\p{Lu}\p{Lt}\p{Lo}]";
		SchemaTypes::$nameChar = "[:_\-.\p{L}\p{Ll}\p{M}\p{Nd}\p{Nl}]";
		SchemaTypes::$name = SchemaTypes::$nameStartChar .  SchemaTypes::$nameChar . "*";
		SchemaTypes::$ncName = "(?:(?!:)" . SchemaTypes::$nameStartChar. ")(?:(?!:)" . SchemaTypes::$nameChar . ")*";

		// SchemaTypes are organized hierarchically
		// BMS 2018-04-09 Fixing the kluge
		SchemaTypes::$xsTypes = array(
			'xs:anyType'				=> null,
			'xs:anySimpleType'			=> 'xs:anyType',
			'xs:string'					=> 'xs:anySimpleType',
			'xs:boolean'				=> 'xs:anySimpleType',
			'xs:decimal'				=> 'xs:anySimpleType',
			'xs:double'					=> 'xs:anySimpleType',
			'xs:float'					=> 'xs:anySimpleType',
			'xs:duration'				=> 'xs:anySimpleType',
			'xs:dateTime'				=> 'xs:anySimpleType',
			'xs:time'					=> 'xs:anySimpleType',
			'xs:date'					=> 'xs:anySimpleType',
			'xs:gYearMonth'				=> 'xs:anySimpleType',
			'xs:gYear'					=> 'xs:anySimpleType',
			'xs:gMonthDay'				=> 'xs:anySimpleType',
			'xs:gDay'					=> 'xs:anySimpleType',
			'xs:gMonth'					=> 'xs:anySimpleType',
			'xs:hexBinary'				=> 'xs:anySimpleType',
			'xs:base64Binary'			=> 'xs:anySimpleType',
			'xs:anyURI'					=> 'xs:anySimpleType',
			'xs:QName'					=> 'xs:anySimpleType',
			'xs:NOTATION'				=> 'xs:anySimpleType',
			'xs:NOTATION'				=> 'xs:anySimpleType',
			'xs:normalizedString'		=> 'xs:string',
			'xs:token'					=> 'xs:normalizedString',
			'xs:Name'					=> 'xs:token',
			'xs:NCName'					=> 'xs:Name',
			'xs:NMTOKEN'				=> 'xs:token',
			'xs:NMTOKENS'				=> 'xs:NMTOKEN',
			'xs:language'				=> 'xs:token',
			'xs:ID'						=> 'xs:NCName',
			'xs:IDREF'					=> 'xs:NCName',
			'xs:ENTITY'					=> 'xs:NCName',
			'xs:IDREFS'					=> 'xs:IDREF',
			'xs:ENTITIES'				=> 'xs:ENTITY',
			'xs:integer'				=> 'xs:decimal',
			'xs:nonPositiveInteger'		=> 'xs:integer',
			'xs:long'					=> 'xs:integer',
			'xs:nonNegativeInteger'		=> 'xs:integer',
			'xs:negativeInteger' 		=> 'xs:nonPositiveInteger',
			'xs:int'					=> 'xs:long',
			'xs:short'					=> 'xs:int',
			'xs:byte'					=> 'xs:short',
			'xs:positiveInteger' 		=> 'xs:nonNegativeInteger',
			'xs:unsignedLong' 			=> 'xs:nonNegativeInteger',
			'xs:unsignedInt' 			=> 'xs:unsignedLong',
			'xs:unsignedShort'			=> 'xs:unsignedInt',
			'xs:unsignedByte'			=> 'xs:unsignedShort',
			'xs:anyComplexType'			=> 'xs:anyType',
			'xs:untypedAtomic'			=> 'xs:anySimpleType',
			// Not really a type but trying to find an easy way to accommodate
			// unions of simple types such as xbrli:dateTimeItemType
			'xs:UNION'					=> 'xs:anySimpleType',
			'xs:yearMonthDuration'		=> 'xs:duration',
			'xs:dayTimeDuration'		=> 'xs:duration',
		);
	}
1370802
def key_for_namespace(cls, namespace):
    
    if namespace:
      return model.Key(cls.KIND_NAME, namespace)
    else:
      return model.Key(cls.KIND_NAME, cls.EMPTY_NAMESPACE_ID)