def download_file(source_url, destination_path):
    CHUNK_SIZE = 1024
    downloaded = 0

    f = None
    r = None
    try:
        headers = {"User-Agent": "PlatformIOLibRegistry/%s %s" % (
            __version__, requests.utils.default_user_agent())}
        r = requests.get(source_url, headers=headers, stream=True)
        if r.status_code != 200:
            raise DLFileError("status=%d, url=%s" % (
                r.status_code, source_url))
        if int(r.headers.get("content-length", 0)) > config['MAX_DLFILE_SIZE']:
            raise DLFileSizeError(config['MAX_DLFILE_SIZE'],
                                  int(r.headers['content-length']))

        f = open(destination_path, "wb")
        for data in r.iter_content(chunk_size=CHUNK_SIZE):
            if config['MAX_DLFILE_SIZE'] > downloaded:
                raise DLFileSizeError(config['MAX_DLFILE_SIZE'], downloaded)
            f.write(data)
            downloaded += CHUNK_SIZE
    finally:
        if f:
            f.close()
        if r:
            r.close()
dataset/ETHPy150Open platformio/platformio-api/platformio_api/util.py/download_file/swapped operands of `>`