in python/fb_ads_library_api_utils.py [0:0]
def get_country_code(country_str):
"""
Convert the country input to valid country code
"""
global supported_countries
try:
country = countries.get(country_str)
except Exception:
country = None
if not country or country.alpha2 not in supported_countries:
return None
return country.alpha2