Read CLDR's names for things in a particular language.
353737
def read_cldr_names(path, language, category):
    
    filename = data_filename('{}/{}/{}.json'.format(path, language, category))
    fulldata = json.load(open(filename, encoding='utf-8'))
    data = fulldata['main'][language]['localeDisplayNames'][category]
    return data
116938
def _str_desc(self, reader):
        """"""
        data_version = reader.data_version
        if data_version is not None:
            data_version = data_version.replace("releases/", "")
        desc = "{OBO}: fmt({FMT}) rel({REL}) {N:,} GO Terms".format(
            OBO=reader.obo_file, FMT=reader.format_version,
            REL=data_version, N=len(self))
        if reader.optobj:
            desc = "{D}; optional_attrs({A})".format(D=desc, A=" ".join(sorted(reader.optobj.optional_attrs)))
        return desc
257340
def name(self):
        """"""
        # pylint:disable=E1101
        return next((self.names.get(x) for x in self._locales if x in
                     self.names), None)
892590
def list_names(cls):
        """"""
        ret = dict([(item['id'], item['name'])
                    for item in cls.list({'items_per_page': 500})])
        return ret
107634
def parse_name(self, line):
        """"""
        end = self.idx
        for char in line[self.idx:]:
            if not char.isalnum() and char not in '\'"_':
                break
            end += 1

        word = line[self.idx:end]

        self.idx = end - 1
        # Update iterator, minus first character which was already read
        self.characters = itertools.islice(self.characters, len(word) - 1,
                                           None)
        self.update_chars()

        return word
127809
def enc_name_descr(name, descr, color=a99.COLOR_DESCR):
    """"""
    return enc_name(name, color)+"<br>"+descr
672304
def _names(lexer):
    """"""
    first = _expect_token(lexer, {NameToken}).value
    rest = _zom_name(lexer)
    rnames = (first, ) + rest
    return rnames[::-1]
62277
def parse_names(cls, names: List[str]) -> T:
        """"""
        value = 0
        iterable = cls  # type: Iterable
        for name in names:
            name = name.lower()
            flag = next((item for item in iterable if name == item.name.lower()), None)
            if not flag:
                raise ValueError("{} is not a member of {}".format(
                    name, cls.__name__))
            value = value | int(flag)
        return cls(value)
81801
def parse_names(cls, expression):
        """"""
        names = set()
        try:
            ast_node = ast.parse(expression, "ast")

            class Visitor(ast.NodeVisitor):
                def visit_Name(self, node):
                    names.add(node.id)

            Visitor().visit(ast_node)
        except Exception:
            pass
        return names
181839
def parse_name(lexer: Lexer) -> NameNode:
    """"""
    token = expect_token(lexer, TokenKind.NAME)
    return NameNode(value=token.value, loc=loc(lexer, token))
775567
function findLanguageNameFromCode( languageCode ) {
  var a = 0;
  var b = LANGUAGES.length;
  var m = b;
  var item, code, name;

  languageCode = languageCode.toLowerCase();

  while( b - a > 1 ) {
    m = Math.floor( (a + b) / 2 );
    item = LANGUAGES[m];
    code = item[0];
    name = item[1];
    if( code == languageCode ) return name;
    if( languageCode < code ) b = m;
    else a = m;
  }
  return null;
}
1140872
def _guess_name_of(self, expr):
        
        if isinstance(expr, ast.Var):
            return expr.value

        if isinstance(expr, ast.Resolve):
            # We know the RHS of resolve is a Literal because that's what
            # Parser.dot_rhs does.
            return expr.rhs.value

        if isinstance(expr, ast.Select) and isinstance(expr.rhs, ast.Literal):
            name = self._guess_name_of(expr.lhs)
            if name is not None:
                return "%s_%s" % (name, expr.rhs.value)

        if isinstance(expr, ast.Apply) and isinstance(expr.func, ast.Var):
            return expr.func.value
1294348
def find_locales(self) -> Dict[str, gettext.GNUTranslations]:
        
        translations = {}

        for name in os.listdir(self.path):
            if not os.path.isdir(os.path.join(self.path, name)):
                continue
            mo_path = os.path.join(self.path, name, 'LC_MESSAGES', self.domain + '.mo')

            if os.path.exists(mo_path):
                with open(mo_path, 'rb') as fp:
                    translations[name] = gettext.GNUTranslations(fp)
            elif os.path.exists(mo_path[:-2] + 'po'):
                raise RuntimeError(f"Found locale '{name} but this language is not compiled!")

        return translations
526160
function scan(language) {
            var i;
            for (i = 0; i < availableLanguages.length; i += 1) {
                if (language.toLowerCase() === availableLanguages[i].toLowerCase()) {
                    return availableLanguages[i];
                }
            }
        }
1167116
def get_name(self, language):
        
        return self.gettext(language, self._name) if self._name else ""
652685
def iter_languages(self):
        """"""
        default_lang = self.babel.default_locale.language
        default_title = self.babel.default_locale.get_display_name(
            default_lang)

        yield (default_lang, default_title)

        for l, title in current_app.config.get('I18N_LANGUAGES', []):
            yield l, title
183336
def names(self):
        """"""
        names = []
        if isinstance(self.source, ast.List):
            for node in self.source.elts:
                if isinstance(node, ast.Str):
                    names.append(node.s)
        return names