def check_country(self, isin):
        """Raise ValueError is the country code is not present or not 
        recognised"""
        if not isin[:2].isalpha():
            raise CountrycodeError('Country code is not present')
        if isin[:2] not in agencies.keys():
            raise CountrycodeError("Country Code '%s' is not valid" % isin[:2])
Raise ValueError is the country code is not present or not 
        recognised
recipes/Python/498277_ISIN_Validator/recipe-498277.py