

def _test_number_length_against_pattern(possible_re, national_number):
    'Helper method to check a number against a particular pattern and\n    determine whether it matches, or is too short or too long. Currently, if a\n    number pattern suggests that numbers of length 7 and 10 are possible, and\n    a number in between these possible lengths is entered, such as of length\n    8, this will return TOO_LONG.\n    '
    match = fullmatch(possible_re, national_number)
    if match:
        return ValidationResult.IS_POSSIBLE
    search = possible_re.match(national_number)
    if search:
        return ValidationResult.TOO_LONG
    else:
        return ValidationResult.TOO_SHORT

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