def example_number_for_type(region_code, num_type):
 if (region_code is None):
  return _example_number_anywhere_for_type(num_type)
 if (not _is_valid_region_code(region_code)):
  return None
 metadata = PhoneMetadata.metadata_for_region(region_code.upper())
 desc = _number_desc_for_type(metadata, num_type)
 if (desc.example_number is not None):
  try:
   return parse(desc.example_number, region_code)
  except NumberParseException:
   pass
 return None

def example_number_for_type ( region_code , num_type ) : if ( region_code is None ) : return _example_number_anywhere_for_type ( num_type ) if ( not _is_valid_region_code ( region_code ) ) : return None metadata = PhoneMetadata . metadata_for_region ( region_code . upper ( ) ) desc = _number_desc_for_type ( metadata , num_type ) if ( desc . example_number is not None ) : try : return parse ( desc . example_number , region_code ) except NumberParseException : pass return None
gets a valid number for the specified region and number type .