def download(self, url):
        ret = b""
        response = self.requester.get(url, stream=True, verify=self.verify)
        if not response.ok:
            raise ConanException("Error %d downloading file %s" % (response.status_code, url))

        try:
            total_length = response.headers.get('content-length')

            if total_length is None:  # no content length header
                ret += response.content
            else:
                dl = 0
                total_length = int(total_length)
                last_progress = None
                for data in response.iter_content(chunk_size=1024):
                    dl += len(data)
                    ret += data
                    units = progress_units(dl, total_length)
                    if last_progress != units:  # Avoid screen refresh if nothing has change
                        if self.output:
                            print_progress(self.output, units)
                        last_progress = units

            return ret
        except Exception as e:
            # If this part failed, it means problems with the connection to server
            raise ConanConnectionError("Download failed, check server, possibly try again\n%s"
                                       % str(e))
dataset/ETHPy150Open conan-io/conan/conans/client/rest/uploader_downloader.py/Downloader.download/original