

def is_possible_number_with_reason(numobj):
    "Check whether a phone number is a possible number.\n\n    It provides a more lenient check than is_valid_number() in the following\n    sense:\n\n     - It only checks the length of phone numbers. In particular, it doesn't\n       check starting digits of the number.\n\n     - It doesn't attempt to figure out the type of the number, but uses\n       general rules which applies to all types of phone numbers in a\n       region. Therefore, it is much faster than is_valid_number.\n\n     - For fixed line numbers, many regions have the concept of area code,\n       which together with subscriber number constitute the national\n       significant number. It is sometimes okay to dial the subscriber number\n       only when dialing in the same area. This function will return true if\n       the subscriber-number-only version is passed in. On the other hand,\n       because is_valid_number validates using information on both starting\n       digits (for fixed line numbers, that would most likely be area codes)\n       and length (obviously includes the length of area codes for fixed line\n       numbers), it will return false for the subscriber-number-only version.\n\n    Arguments:\n    numobj -- The number object that needs to be checked\n\n    Returns a value from ValidationResult which indicates whether the number\n    is possible\n    "
    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)

dataset/ETHPy150Open daviddrysdale/python-phonenumbers/python/phonenumbers/phonenumberutil.py is_possible_number_with_reason/original