Get the dictionary of {namespace: {name: encoding}} stored in the internal identifier parser.
183630
def _namespace_dict(self) -> Mapping[str, Mapping[str, str]]:
        """"""
        return self.identifier_parser.namespace_to_terms
454221
def namespaces(*prefixes):
    
    namespaces = {}
    for prefix in prefixes:
        namespaces[prefix] = _nsmap[prefix]
    return namespaces
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)
742011
def GetDictToFormat(self):
    """"""
    d = {}
    for k, v in self.__dict__.items():
      # TODO: Better handling of unicode/utf-8 within Schedule objects.
      # Concatinating a unicode and utf-8 str object causes an exception such
      # as "UnicodeDecodeError: 'ascii' codec can't decode byte ..." as python
      # tries to convert the str to a unicode. To avoid that happening within
      # the problem reporter convert all unicode attributes to utf-8.
      # Currently valid utf-8 fields are converted to unicode in _ReadCsvDict.
      # Perhaps all fields should be left as utf-8.
      d[k] = util.EncodeUnicode(v)
    return d
75791
def getprefixes(self):
        """"""
        namespaces = []
        for l in (self.params, self.types):
            for t,r in l:
                ns = r.namespace()
                if ns[1] is None: continue
                if ns[1] in namespaces: continue
                if Namespace.xs(ns) or Namespace.xsd(ns):
                    continue
                namespaces.append(ns[1])
                if t == r: continue
                ns = t.namespace()
                if ns[1] is None: continue
                if ns[1] in namespaces: continue
                namespaces.append(ns[1])
        i = 0
        namespaces.sort()
        for u in namespaces:
            p = self.nextprefix()
            ns = (p, u)
            self.prefixes.append(ns)
1121979
def encoded_dict(in_dict):
    
    out_dict = {}
    for k, v in in_dict.items():
        if isinstance(v, unicode):
            if sys.version_info < (3, 0):
                v = v.encode('utf8')
        elif isinstance(v, str):
            # Must be encoded in UTF-8
            if sys.version_info < (3, 0):
                v.decode('utf8')
        out_dict[k] = v
    return out_dict
168903
def _identify_dict(core):
    """"""
    if not core:
        return {}, 1, (), int

    core = core.copy()
    key = sorted(core.keys(), key=chaospy.poly.base.sort_key)[0]
    shape = numpy.array(core[key]).shape
    dtype = numpy.array(core[key]).dtype
    dim = len(key)
    return core, dim, shape, dtype
589199
def asDictionary(self):
        
        self._dict = {
            "type" : self._type,
            "workspaceId" : self._workspaceId,
            "dataSourceName": self._dataSourceName,
            "gdbVersion" : self._gdbVersion
        }
        return self._dict
915530
def get_type_data(name):
    
    name = name.upper()
    if name in ISO_LANGUAGE_CODES:
        name = ISO_LANGUAGE_CODES[name]
    if name in ISO_MAJOR_LANGUAGE_TYPES:
        namespace = '639-2'
        lang_name = ISO_MAJOR_LANGUAGE_TYPES[name]
    elif name in ISO_OTHER_LANGUAGE_TYPES:
        namespace = '639-3'
        lang_name = ISO_OTHER_LANGUAGE_TYPES[name]
    else:
        raise NotFound('Language Type: ' + name)

    return {
        'authority': 'ISO',
        'namespace': namespace,
        'identifier': name,
        'domain': 'DisplayText Languages',
        'display_name': lang_name + ' Language Type',
        'display_label': lang_name,
        'description': ('The display text language type for the ' +
                        lang_name + ' language.')
    }
754588
def get_attrdict(self) -> OrderedNamespace:
        
        # noinspection PyUnresolvedReferences
        columns = self.__table__.columns.keys()
        values = (getattr(self, x) for x in columns)
        zipped = zip(columns, values)
        return OrderedNamespace(zipped)
644229
def get_named_unicode(self, i):
        """"""

        index = i.index
        value = []
        try:
            if next(i) != '{':
                raise ValueError("Named Unicode missing '{' %d!" % (i.index - 1))
            c = next(i)
            while c != '}':
                value.append(c)
                c = next(i)
        except Exception:
            raise SyntaxError("Unmatched '{' at %d!" % index)

        return ''.join(value)
738120
def decode_name(s):
    """"""
    # Some names contain XML-like entity codes
    return re.sub(r'&#(\d+);', lambda x: chr(int(x.group(1))), s)
173210
def get_named_unicode(self, i):
        """"""

        index = i.index
        value = []
        try:
            if next(i) != '{':
                raise SyntaxError("Named Unicode missing '{'' at %d!" % (i.index - 1))
            c = next(i)
            while c != '}':
                value.append(c)
                c = next(i)
        except StopIteration:
            raise SyntaxError("Unmatched '}' at %d!" % index)

        return ''.join(value)
1205053
def getDictionary(self):
		
		if os.path.exists(self.jsonFile):
			return json.loads(Utility.readFile(self.jsonFile))
		else:
			return {}
950945
def get_type_data(name):
    
    name = name.upper()
    try:
        return {
            'authority': 'okapia.net',
            'namespace': 'TextFormats',
            'identifier': name,
            'domain': 'DisplayText Formats',
            'display_name': FORMAT_TYPES[name] + ' Format Type',
            'display_label': FORMAT_TYPES[name],
            'description': ('The display text format type for the ' +
                            FORMAT_TYPES[name] + ' format.')
        }
    except KeyError:
        raise NotFound('Format Type:' + name)
307727
def _classnamedict(self, classname, namespace):
        """"""
        clns = self._classnamelist(classname, namespace)
        rtn_dict = NocaseDict()
        for cln in clns:
            rtn_dict[cln] = cln
        return rtn_dict
1328895
def get_names(graph):
    
    rv = defaultdict(set)
    for namespace, name in _identifier_filtered_iterator(graph):
        rv[namespace].add(name)
    return dict(rv)