def http_get(self, url, headers={}, timeout=20, cache_enabled=True, allow_redirects=False):
        """ Returns a requests.models.Response object or raises exception
            on failure. Will cache requests to the same URL. """

        headers["User-Agent"] = USER_AGENT

        if cache_enabled:
            cache = cache_module.Cache(self.max_cache_duration)
            cached_response = get_page_from_cache(url, headers, allow_redirects, cache)
            if cached_response:
                self.logger.debug(u"{provider_name} CACHE HIT on {url}".format(
                    provider_name=self.provider_name, url=url))
                return cached_response
            
        try:
            # analytics.track("CORE", "Sent GET to Provider", {"provider": self.provider_name, "url": url}, 
            #     context={ "providers": { 'Mixpanel': False } })
            try:
                self.logger.info(u"{provider_name} LIVE GET on {url}".format(
                    provider_name=self.provider_name, url=url))
            except __HOLE__:
                self.logger.info(u"{provider_name} LIVE GET on an url that throws UnicodeDecodeError".format(
                    provider_name=self.provider_name))

            r = requests.get(url, headers=headers, timeout=timeout, allow_redirects=allow_redirects, verify=False)
            if r and not r.encoding:
                r.encoding = "utf-8"     
            if r and cache_enabled:
                store_page_in_cache(url, headers, allow_redirects, r, cache)

        except (requests.exceptions.Timeout, socket.timeout) as e:
            self.logger.info(u"{provider_name} provider timed out on GET on {url}".format(
                provider_name=self.provider_name, url=url))
            # analytics.track("CORE", "Received no response from Provider (timeout)", 
            #     {"provider": self.provider_name, "url": url})
            raise ProviderTimeout("Provider timed out during GET on " + url, e)

        except requests.exceptions.RequestException as e:
            self.logger.exception(u"{provider_name} RequestException on GET on {url}".format(
                provider_name=self.provider_name, url=url))
            # analytics.track("CORE", "Received RequestException from Provider", 
            #     {"provider": self.provider_name, "url": url})
            raise ProviderHttpError("RequestException during GET on: " + url, e)

        return r
dataset/ETHPy150Open Impactstory/total-impact-webapp/totalimpact/providers/provider.py/Provider.http_get