def _find_lang(langdict, lang, script, region):
 full_locale = _full_locale(lang, script, region)
 if ((full_locale in _LOCALE_NORMALIZATION_MAP) and (_LOCALE_NORMALIZATION_MAP[full_locale] in langdict)):
  return langdict[_LOCALE_NORMALIZATION_MAP[full_locale]]
 if (full_locale in langdict):
  return langdict[full_locale]
 if (script is not None):
  lang_script = ('%s_%s' % (lang, script))
  if (lang_script in langdict):
   return langdict[lang_script]
 if (region is not None):
  lang_region = ('%s_%s' % (lang, region))
  if (lang_region in langdict):
   return langdict[lang_region]
 if (lang in langdict):
  return langdict[lang]
 if _may_fall_back_to_english(lang):
  return langdict.get('en', None)
 else:
  return None

def _find_lang ( langdict , lang , script , region ) : full_locale = _full_locale ( lang , script , region ) if ( ( full_locale in _LOCALE_NORMALIZATION_MAP ) and ( _LOCALE_NORMALIZATION_MAP [ full_locale ] in langdict ) ) : return langdict [ _LOCALE_NORMALIZATION_MAP [ full_locale ] ] if ( full_locale in langdict ) : return langdict [ full_locale ] if ( script is not None ) : lang_script = ( '%s_%s' % ( lang , script ) ) if ( lang_script in langdict ) : return langdict [ lang_script ] if ( region is not None ) : lang_region = ( '%s_%s' % ( lang , region ) ) if ( lang_region in langdict ) : return langdict [ lang_region ] if ( lang in langdict ) : return langdict [ lang ] if _may_fall_back_to_english ( lang ) : return langdict . get ( 'en' , None ) else : return None
return the entry in the dictionary for the given language information .