def execute(self, request):
        """Execute a request and return a response"""
        url = request.uri
        if request.parameters:
            url += '?' + urlencode(request.parameters)

        if request.headers:
            headers = dict(self._headers, **request.headers)
        else:
            headers = self._headers

        kwargs = dict(
            method=Method._VALUES_TO_NAMES[request.method],
            url=url,
            body=request.body,
            headers=headers,
            timeout=self._timeout,
        )

        retry = 0
        server = getattr(self._local, "server", None)
        while True:
            if not server:
                self._local.server = server = self._get_server()
            try:
                parse_result = urlparse(server)
                conn = get_pool().connection_from_host(parse_result.hostname,
                                                         parse_result.port,
                                                         parse_result.scheme)
                response = conn.urlopen(**kwargs)
                return RestResponse(status=response.status,
                                    body=response.data,
                                    headers=response.headers)
            except (IOError, urllib3.exceptions.HTTPError) as ex:
                self._drop_server(server)
                self._local.server = server = None
                if retry >= self._max_retries:
                    logger.error("Client error: bailing out after %d failed retries",
                                 self._max_retries, exc_info=1)
                    raise NoServerAvailable(ex)
                logger.exception("Client error: %d retries left", self._max_retries - retry)
                retry += 1
dataset/ETHPy150Open aparo/pyes/pyes/connection_http.py/Connection.execute/original