The example I provided is a basic implementation that should work in most cases. It's not the fastest or most optimized method, but it's simple and straightforward.

If you need to perform country detection frequently and you need optimized performance, you might want to consider caching the result or using a more optimized library. You can also optimize your code by using the most efficient method for getting the country code and by avoiding unnecessary operations.

Remember to also test your implementation on a variety of devices and network conditions to ensure that it works as expected and that it provides the desired level of performance.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence