'Returns the country code for the given IP Address or FQDN.'

def country_code(self, query):

    query = self._check_query(query, city_or_country=True)
    if self._country:
        if ipv4_re.match(query):
            return GeoIP_country_code_by_addr(self._country, query)
        else:
            return GeoIP_country_code_by_name(self._country, query)
    else:
        return self.city(query)['country_code']
