Get supported languages (by querying the server).
8079
def _get_languages(cls) -> set:
        """"""
        if not cls._server_is_alive():
            cls._start_server_on_free_port()
        url = urllib.parse.urljoin(cls._url, 'Languages')
        languages = set()
        for e in cls._get_root(url, num_tries=1):
            languages.add(e.get('abbr'))
            languages.add(e.get('abbrWithVariant'))
        return languages
51946
def available_languages(self):
        
        available_languages = getattr(self, '_available_languages', None)
        if available_languages:
            return available_languages
        try:
            languages = os.listdir(self.data_directory)
        except OSError:
            raise StopWordError(
                "'datas' directory is unreadable, check your installation.")
        languages = sorted(map(lambda x: x.replace('.txt', ''), languages))
        setattr(self, '_available_languages', languages)
        return languages
1161034
public function listLanguages(): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/languages', $this->getOwner(),
            $this->getRepo()));
    }
630682
public function getLanguages()
    {
        if ($this->_languages === null) {
            $this->_languages = (new DbQuery())->select(['short_code', 'id'])->indexBy('short_code')->from('admin_lang')->all();
        }

        return $this->_languages;
    }
337857
def get_translations(self, domain=None, locale=None):
        
        if locale is None:

            if self.locale is None:
                return support.NullTranslations()

            locale = self.locale

        if domain is None:
            domain = self.cfg.domain

        if (domain, locale.language) not in self.translations:
            translations = None
            for locales_dir in reversed(self.cfg.locales_dirs):
                trans = support.Translations.load(
                    locales_dir, locales=locale, domain=domain)
                if translations:
                    translations._catalog.update(trans._catalog)
                else:
                    translations = trans

            self.translations[(domain, locale.language)] = translations

        return self.translations[(domain, locale.language)]
296793
def register_languages():
    """"""
    for language in set(SUPPORTED_LANGUAGES) - {"en"}:
        language_stemmer = partial(nltk_stemmer, get_language_stemmer(language))
        Pipeline.register_function(language_stemmer, "stemmer-{}".format(language))
1286518
def get_language_database():
    '''
    
    '''
    lang = None
    language = get_language()
    if language:
        for x in settings.LANGUAGES_DATABASES:
            if x.upper() == language.upper():
                lang = language
                break

    if lang is None:
        lang = settings.LANGUAGES_DATABASES[0]
    return lang.lower()
1281136
def get_languages(self):
        
        if self._languages:
            return self._languages
        self._languages = cache.get(self.PAGE_LANGUAGES_KEY % (self.pk))
        if self._languages is not None:
            return self._languages

        languages = [c['language'] for
            c in Content.objects.filter(page=self,
            type="slug").values('language')]
        # remove duplicates
        languages = sorted(set(languages))
        cache.set(self.PAGE_LANGUAGES_KEY % (self.pk), languages)
        self._languages = languages
        return languages
987022
def get_for_queryset(self, obj_queryset):
        """"""
        qs = Tag.objects.language(get_language())
        if obj_queryset.count() == 0:
            return qs.none()
        qs = qs.filter(
            tagged_items__object_id__in=[
                obj.id for obj in obj_queryset],
            tagged_items__content_type=ctype_models.ContentType.objects.get_for_model(obj_queryset[0]))  # NOQA
        return qs.distinct()
1069368
def poll_open_file_languages(self):
        """"""
        languages = []
        for index in range(self.get_stack_count()):
            languages.append(
                self.tabs.widget(index).language.lower())
        return set(languages)
880929
static SupportedLanguages listSupportedLanguages(String projectId, String location) {
    try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {

      LocationName locationName =
          LocationName.newBuilder().setProject(projectId).setLocation(location).build();
      GetSupportedLanguagesRequest getSupportedLanguagesRequest =
          GetSupportedLanguagesRequest.newBuilder().setParent(locationName.toString()).build();

      // Call the API
      ApiFuture<SupportedLanguages> future =
          translationServiceClient
              .getSupportedLanguagesCallable()
              .futureCall(getSupportedLanguagesRequest);

      SupportedLanguages response = future.get();
      List<SupportedLanguage> languages = response.getLanguagesList();
      for (SupportedLanguage language : languages) {
        System.out.printf("Code: %s\n", language.getLanguageCode());
      }

      return response;

    } catch (Exception e) {
      throw new RuntimeException("Couldn't create client.", e);
    }
  }
1197513
def supported_tasks(self, lang=None):
    
    if lang:
      collection = self.get_collection(lang=lang)
      return [x.id.split('.')[0] for x in collection.packages]
    else:
      return [x.name.split()[0] for x in self.collections() if Downloader.TASK_PREFIX in x.id]
1354591
def get_language_details(self, language):
        """"""
        for lang in self.user_data.languages:
            if language == lang['language_string']:
                return lang

        return {}
1222448
def supported_language(lang):
    
    try:
      self.get_collection(lang=lang)
      return True
    except LanguageNotSupported as e:
      return False
407806
def get_fallback_languages():
    """"""
    lang = translation.get_language()
    fallback_list = settings.FALLBACK_LANGUAGES.get(lang, None)
    if fallback_list:
        return fallback_list

    return settings.FALLBACK_LANGUAGES.get(lang[:2], [])
1348151
public function getLanguages($refresh = false)
    {
        if (empty($this->detection['acceptLanguage']) || $refresh) {
            $this->detectLanguage($this->acceptLanguage);
        }

        return $this->languages;
    }
771428
def get_languages(self, abbreviations=False):
        
        data = []

        for lang in self.user_data.languages:
            if lang['learning']:
                if abbreviations:
                    data.append(lang['language'])
                else:
                    data.append(lang['language_string'])

        return data