def validate_country_codes(parser, arg):
    """Check that the supplied 2 country code is correct."""
    country_codes = ["us", "de"]
    if arg.strip().lower() not in country_codes:
        parser.error("Invalid country code. Available codes are: %s" %
            ", ".join(country_codes))
    else:
        return arg.strip().lower()