Get praticed languages.

        :param abbreviations: Get language as abbreviation or not
        :type abbreviations: bool
        :return: List of languages
        :rtype: list of str
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
710445
def print_languages(ctx, param, value):
    
    if not value or ctx.resilient_parsing:
        return
    try:
        langs = tts_langs()
        langs_str_list = sorted("{}: {}".format(k, langs[k]) for k in langs)
        click.echo('  ' + '\n  '.join(langs_str_list))
    except RuntimeError as e:  # pragma: no cover
        log.debug(str(e), exc_info=True)
        raise click.ClickException("Couldn't fetch language list.")
    ctx.exit()
149516
def get_abbreviations(self, combine=False):
        
        abbreviations = []
        try:
            type_abbreviation = self.session.get_resource(BASE_URI_TYPES % "abbreviation"
                                                        , self.session.get_class(surf.ns.ECRM['E55_Type']))
            abbreviations = [unicode(label)
                                for title in self.efrbroo_P102_has_title
                                    for abbreviation in title.ecrm_P139_has_alternative_form
                                        for label in abbreviation.rdfs_label
                                            if title.uri == surf.ns.EFRBROO['E35_Title']
                                             and abbreviation.ecrm_P2_has_type.first == type_abbreviation]

            if (combine and len(abbreviations)>0 and len(self.author.get_abbreviations())>=1):
                abbreviations = ["%s %s"%(author_abbrev, work_abbrev)
                                                for author_abbrev, work_abbrev in itertools.product(self.author.get_abbreviations()
                                                                                                    , self.get_abbreviations())]
        except Exception as e:
            logger.debug("Exception raised when getting abbreviations for %a"%self)
        finally:
            return abbreviations
181505
def get_languages_from_model(app_label, model_label):
        
        try:
            mod_lan = TransModelLanguage.objects.filter(model='{} - {}'.format(app_label, model_label)).get()
            languages = [lang.code for lang in mod_lan.languages.all()]
            return languages
        except TransModelLanguage.DoesNotExist:
            return []
1167116
def get_name(self, language):
        
        return self.gettext(language, self._name) if self._name else ""
300379
def get_lang_dict(self):
        """"""
        r = self.yandex_translate_request("getLangs")
        self.handle_errors(r)

        return r.json()["langs"]
194671
def languages(self, key, value):
    """"""
    languages = self.get('languages', [])

    values = force_list(value.get('a'))
    for value in values:
        for language in RE_LANGUAGE.split(value):
            try:
                name = language.strip().capitalize()
                languages.append(pycountry.languages.get(name=name).alpha_2)
            except KeyError:
                pass

    return languages
339292
def get_abbreviations(kb):
    
    return {"%s$$n%i" % (author.get_urn(), i): abbrev
                for author in kb.get_authors()
                for i, abbrev in enumerate(author.get_abbreviations())
                if author.get_urn() is not None}
1311937
def linguist_field_names(self):
        
        return list(self.model._linguist.fields) + list(
            utils.get_language_fields(self.model._linguist.fields)
        )
819889
def get_authors(self, language):
        
        return self.gettext(language, self._author) if self._author else ""
686688
def rtl_langs(self):
        
        def is_rtl(lang):
            """
            Returns True if lang is a RTL language

            args:
                lang (str): The language to be checked

            Returns:
                True if lang is an RTL language.
            """
            # Base RTL langs are Arabic, Farsi, Hebrew, and Urdu
            base_rtl = ['ar', 'fa', 'he', 'ur']

            # do this to capture both 'fa' and 'fa_IR'
            return any([lang.startswith(base_code) for base_code in base_rtl])

        return sorted(set([lang for lang in self.translated_locales if is_rtl(lang)]))
1161469
def as_languages(self):
        
        langs = []
        for culture_code in self.select_related('language', 'country').all():
            lang = culture_code.language
            lang.country = culture_code.country
            lang.culturecode = culture_code.code
            langs.append(lang)
        return langs
1290385
def languages(self):
        
        languages = []

        for language in self.cache['languages']:
            language = Structure(
                id = language['id'],
                name = language['name']
            )

            languages.append(language)

        return languages
792460
function getSupportedLanguages() {
		return [
			'grc' => __( 'Ancient Greek', 'pressbooks' ),
			'ar' => __( 'Arabic', 'pressbooks' ),
			'bn' => __( 'Bengali', 'pressbooks' ),
			'he' => __( 'Biblical Hebrew', 'pressbooks' ),
			'cans' => __( 'Canadian Indigenous Syllabics', 'pressbooks' ),
			'hi' => __( 'Devanagari (Hindi and Sanskrit)', 'pressbooks' ),
			'zh_HANS' => __( 'Chinese (Simplified)', 'pressbooks' ),
			'zh_HANT' => __( 'Chinese (Traditional)', 'pressbooks' ),
			'cop' => __( 'Coptic', 'pressbooks' ),
			'gu' => __( 'Gujarati', 'pressbooks' ),
			'pan' => __( 'Punjabi (Gurmukhi)', 'pressbooks' ),
			'ja' => __( 'Japanese', 'pressbooks' ),
			'kn' => __( 'Kannada', 'pressbooks' ),
			'ko' => __( 'Korean', 'pressbooks' ),
			'ml' => __( 'Malayalam', 'pressbooks' ),
			'or' => __( 'Odia', 'pressbooks' ),
			'syr' => __( 'Syriac', 'pressbooks' ),
			'ta' => __( 'Tamil', 'pressbooks' ),
			'te' => __( 'Telugu', 'pressbooks' ),
			'bo' => __( 'Tibetan', 'pressbooks' ),
			'tr' => __( 'Turkish', 'pressbooks' ),
		];
	}
804331
def get_languages_from_application(app_label):
        
        try:
            mod_lan = TransApplicationLanguage.objects.filter(application=app_label).get()
            languages = [lang.code for lang in mod_lan.languages.all()]
            return languages
        except TransApplicationLanguage.DoesNotExist:
            return []
633061
def languages
      unless @languages_cache
        response = call_request(:get_languages)

        languages = response.to_hash[:get_languages_response][:return][:item][1][:value][:item]
        # Create a sorted hash
        @languages_cache = Hash[create_dict(languages).sort_by{|k,v| k.to_i}]
      end
      return @languages_cache
    end
134239
def language(s):
    
    s = decode_utf8(s)
    s = set(w.strip(PUNCTUATION) for w in s.replace("'", "' ").split())
    n = float(len(s) or 1)
    p = {}
    for xx in LANGUAGES:
        lexicon = _module(xx).__dict__["lexicon"]
        p[xx] = sum(1 for w in s if w in lexicon) / n
    return max(p.items(), key=lambda kv: (kv[1], int(kv[0] == "en")))