def _build_url(self, query_params):
        """Build the final URL to be passed to urllib

        :param query_params: A dictionary of all the query parameters
        :type query_params: dictionary
        :return: string
        """
        url = ''
        count = 0
        while count < len(self._url_path):
            url += '/{0}'.format(self._url_path[count])
            count += 1
        if query_params:
            url_values = urlencode(sorted(query_params.items()))
            url = '{0}?{1}'.format(url, url_values)
        url = self._build_versioned_url(url) if self._version else self.host + url
        return url
dataset/ETHPy150Open sendgrid/python-http-client/python_http_client/client.py/Client._build_url/original