def get_native_language_name(lang_scr):
    """Get the name of a language in its own locale."""
    try:
        return extra_locale_data.NATIVE_NAMES[lang_scr]
    except __HOLE__:
        pass

    if '-' in lang_scr:
        language = lang_scr.split('-')[0]
    else:
        language = lang_scr

    locl = lang_scr
    while locl != 'root':
        for directory in ['common', 'seed']:
            file_path = path.join(
                directory, 'main', locl.replace('-', '_')+'.xml')
            for name_to_find in [lang_scr, language]:
                native_name = get_language_name_from_file(
                    name_to_find, file_path)
                if native_name:
                    return native_name
        locl = find_parent_locale(locl)
    return None
dataset/ETHPy150Open googlei18n/nototools/nototools/generate_website_data.py/get_native_language_name