def is_valid_short_number(numobj):
 region_codes = region_codes_for_country_code(numobj.country_code)
 short_number = national_significant_number(numobj)
 region_code = _region_code_for_short_number_from_region_list(numobj, region_codes)
 if ((len(region_codes) > 1) and (region_code is not None)):
  return True
 return is_valid_short_number_for_region(short_number, region_code)

def is_valid_short_number ( numobj ) : region_codes = region_codes_for_country_code ( numobj . country_code ) short_number = national_significant_number ( numobj ) region_code = _region_code_for_short_number_from_region_list ( numobj , region_codes ) if ( ( len ( region_codes ) > 1 ) and ( region_code is not None ) ) : return True return is_valid_short_number_for_region ( short_number , region_code )
tests whether a short number matches a valid pattern .