Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""Initialize the Handler object with country name list and the cache initialized."""
self.access_token = access_token
self.countries = self._read_country_names(kwargs.get("countries_file"))
self.request_options = kwargs.get("request_options", {})
if "timeout" not in self.request_options:
self.request_options["timeout"] = self.REQUEST_TIMEOUT_DEFAULT
if "cache" in kwargs:
self.cache = kwargs["cache"]
else:
cache_options = kwargs.get("cache_options", {})
if "maxsize" not in cache_options:
cache_options["maxsize"] = self.CACHE_MAXSIZE
if "ttl" not in cache_options:
cache_options["ttl"] = self.CACHE_TTL
self.cache = DefaultCache(**cache_options)