

def invalid_example_number(region_code):
    'Gets an invalid number for the specified region.\n\n    This is useful for unit-testing purposes, where you want to test what\n    will happen with an invalid number. Note that the number that is\n    returned will always be able to be parsed and will have the correct\n    country code. It may also be a valid *short* number/code for this\n    region. Validity checking such numbers is handled with shortnumberinfo.\n\n    Arguments:\n    region_code -- The region for which an example number is needed.\n\n\n    Returns an invalid number for the specified region. Returns None when an\n    unsupported region or the region 001 (Earth) is passed in.\n    '
    if (not _is_valid_region_code(region_code)):
        return None
    metadata = PhoneMetadata.metadata_for_region(region_code.upper())
    desc = _number_desc_for_type(metadata, PhoneNumberType.FIXED_LINE)
    if (desc.example_number is None):
        return None
    example_number = desc.example_number
    phone_number_length = (len(example_number) - 1)
    while (phone_number_length >= _MIN_LENGTH_FOR_NSN):
        number_to_try = example_number[:phone_number_length]
        try:
            possibly_valid_number = parse(number_to_try, region_code)
            if (not is_valid_number(possibly_valid_number)):
                return possibly_valid_number
        except NumberParseException:
            pass
        phone_number_length -= 1
    return None

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