def is_possible_number_with_reason(numobj):
 national_number = national_significant_number(numobj)
 country_code = numobj.country_code
 if (not _has_valid_country_calling_code(country_code)):
  return ValidationResult.INVALID_COUNTRY_CODE
 region_code = region_code_for_country_code(country_code)
 metadata = PhoneMetadata.metadata_for_region_or_calling_code(country_code, region_code)
 possible_re = re.compile((metadata.general_desc.possible_number_pattern or U_EMPTY_STRING))
 return _test_number_length_against_pattern(possible_re, national_number)

def is_possible_number_with_reason ( numobj ) : national_number = national_significant_number ( numobj ) country_code = numobj . country_code if ( not _has_valid_country_calling_code ( country_code ) ) : return ValidationResult . INVALID_COUNTRY_CODE region_code = region_code_for_country_code ( country_code ) metadata = PhoneMetadata . metadata_for_region_or_calling_code ( country_code , region_code ) possible_re = re . compile ( ( metadata . general_desc . possible_number_pattern or U_EMPTY_STRING ) ) return _test_number_length_against_pattern ( possible_re , national_number )
check whether a phone number is a possible number .