def country_code_for_valid_region(region_code):
 metadata = PhoneMetadata.metadata_for_region(region_code.upper(), None)
 if (metadata is None):
  raise Exception(('Invalid region code %s' % region_code))
 return metadata.country_code

def country_code_for_valid_region ( region_code ) : metadata = PhoneMetadata . metadata_for_region ( region_code . upper ( ) , None ) if ( metadata is None ) : raise Exception ( ( 'Invalid region code %s' % region_code ) ) return metadata . country_code
returns the country calling code for a specific region .