def _prefix_description_for_number(data, longest_prefix, numobj, lang, script=None, region=None):
 e164_num = format_number(numobj, PhoneNumberFormat.E164)
 if (not e164_num.startswith(U_PLUS)):
  raise Exception('Expect E164 number to start with +')
 for prefix_len in range(longest_prefix, 0, (-1)):
  prefix = e164_num[1:(1 + prefix_len)]
  if (prefix in data):
   name = _find_lang(data[prefix], lang, script, region)
   if (name is not None):
    return name
   else:
    return U_EMPTY_STRING
 return U_EMPTY_STRING

def _prefix_description_for_number ( data , longest_prefix , numobj , lang , script = None , region = None ) : e164_num = format_number ( numobj , PhoneNumberFormat . E164 ) if ( not e164_num . startswith ( U_PLUS ) ) : raise Exception ( 'Expect E164 number to start with +' ) for prefix_len in range ( longest_prefix , 0 , ( - 1 ) ) : prefix = e164_num [ 1 : ( 1 + prefix_len ) ] if ( prefix in data ) : name = _find_lang ( data [ prefix ] , lang , script , region ) if ( name is not None ) : return name else : return U_EMPTY_STRING return U_EMPTY_STRING
return a text description of a phonenumber for the given language .