def _external_request(self, method, url, *args, **kwargs):
        self.last_url = url
        if url in self.responses.keys() and method == 'get':
            return self.responses[url] # return from cache if its there

        headers = kwargs.pop('headers', None)
        custom = {'User-Agent': useragent}
        if headers:
            headers.update(custom)
            kwargs['headers'] = headers
        else:
            kwargs['headers'] = custom

        if self.timeout:
            # add timeout parameter to requests.get if one was passed in on construction...
            kwargs['timeout'] = self.timeout

        response = getattr(requests, method)(url, *args, **kwargs)

        if self.verbose:
            print("Got Response: %s" % url)

        if response.status_code == 503:
            raise SkipThisService("503 - Temporarily out of service.")

        if method == 'get':
            self.responses[url] = response # cache for later

        self.last_raw_response = response
        return response
Use physical quantities from an existing output file
dataset/ETHPy150Open priestc/moneywagon/moneywagon/core.py/Service._external_request--crossover with--dataset/ETHPy150Open hyperion-rt/hyperion/hyperion/model/model.py/Model.use_quantities