def create_langs_object():
    langs = {}
    for lang_scr in sorted(set(written_in_scripts) | all_used_lang_scrs):
        lang_object = {}
        if '-' in lang_scr:
            language, script = lang_scr.split('-')
        else:
            language = lang_scr
            try:
                script = find_likely_script(language)
            except __HOLE__:
                print "no likely script for %s" % language
                continue

        lang_object['name'] = get_english_language_name(lang_scr)
        native_name = get_native_language_name(lang_scr)
        if native_name is not None:
            lang_object['nameNative'] = native_name

        lang_object['rtl'] = is_script_rtl(script)

        if script == 'Kana':
            script = 'Jpan'

        if script not in supported_scripts:
            # Scripts we don't have fonts for yet
            print('No font supports the %s script (%s) needed for the %s language.'
                  % (english_script_name[script], script, lang_object['name']))
            assert script in {
                'Bass',  # Bassa Vah
                'Lina',  # Linear A
                'Mani',  # Manichaean
                'Merc',  # Meroitic Cursive
                'Mroo',  # Mro
                'Narb',  # Old North Arabian
                'Orya',  # Oriya
                'Plrd',  # Miao
                'Sora',  # Sora Sompeng
                'Thaa',  # Thaana
                'Tibt',  # Tibetan
            }

            lang_object['families'] = []
        else:
            sample_text = get_sample_text(language, script)
            lang_object['sample'] = sample_text

            if script in {'Latn', 'Grek', 'Cyrl'}:
                query_script = ''
            else:
                query_script = script

            # FIXME(roozbeh): Figure out if the language is actually supported
            # by the font + Noto LGC. If it's not, don't claim support.
            fonts = [font for font in all_fonts if font.script == query_script]

            # For certain languages of Pakistan, add Nastaliq font
            if lang_scr in {'bal', 'hnd', 'hno', 'ks-Arab', 'lah',
                            'pa-Arab', 'skr', 'ur'}:
                fonts += [font for font in all_fonts if font.script == 'Aran']

            family_keys = set([font.key for font in fonts])

            lang_object['families'] = sorted(family_keys)
            for family in family_keys:
                family_to_langs[family].add(lang_scr)

        langs[lang_scr] = lang_object
    return langs
dataset/ETHPy150Open googlei18n/nototools/nototools/generate_website_data.py/create_langs_object