

def _raw_input_contains_national_prefix(raw_input, national_prefix, region_code):
    'Check if raw_input, which is assumed to be in the national format, has a\n    national prefix. The national prefix is assumed to be in digits-only\n    form.'
    nnn = normalize_digits_only(raw_input)
    if nnn.startswith(national_prefix):
        try:
            return is_valid_number(parse(nnn[len(national_prefix):], region_code))
        except NumberParseException:
            return False
    return False

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