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:
        # If a matching region had been found for the phone number from among two or more regions,
        # then we have already implicitly verified its validity for that region.
        return True
    return is_valid_short_number_for_region(short_number, region_code)
Tests whether a short number matches a valid pattern.
dataset/ETHPy150Open daviddrysdale/python-phonenumbers/python/phonenumbers/shortnumberinfo.py/is_valid_short_number