def country_name_for_number(numobj, lang, script=None, region=None):
 region_codes = region_codes_for_country_code(numobj.country_code)
 if (len(region_codes) == 1):
  return _region_display_name(region_codes[0], lang, script, region)
 else:
  region_where_number_is_valid = u('ZZ')
  for region_code in region_codes:
   if is_valid_number_for_region(numobj, region_code):
    if (region_where_number_is_valid != u('ZZ')):
     return U_EMPTY_STRING
    region_where_number_is_valid = region_code
  return _region_display_name(region_where_number_is_valid, lang, script, region)

def country_name_for_number ( numobj , lang , script = None , region = None ) : region_codes = region_codes_for_country_code ( numobj . country_code ) if ( len ( region_codes ) == 1 ) : return _region_display_name ( region_codes [ 0 ] , lang , script , region ) else : region_where_number_is_valid = u ( 'ZZ' ) for region_code in region_codes : if is_valid_number_for_region ( numobj , region_code ) : if ( region_where_number_is_valid != u ( 'ZZ' ) ) : return U_EMPTY_STRING region_where_number_is_valid = region_code return _region_display_name ( region_where_number_is_valid , lang , script , region )
returns the customary display name in the given langauge for the given territory the given phonenumber object is from .