def invalid_example_number(region_code):
 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

def invalid_example_number ( region_code ) : 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
gets an invalid number for the specified region .