@staticmethod
    def download_file(url, path=None, checksum=None, on_complete=None):
        try:
            if on_complete:
                from ..threads import BackgroundThread
                return BackgroundThread(
                    func=Downloader.download_file,
                    args=[url, path, checksum, None],
                    on_complete=on_complete
                )
            else:
                data = Downloader.download(url)
                if checksum and hashlib.sha256(data).hexdigest() != checksum:
                    return None
                path = path or os.path.basename(url)
                f = open(path, "wb")
                f.write(data)
                f.close()
                return os.path.exists(path)
        except Exception as e:
            raise e
Default response processing.
dataset/ETHPy150Open spywhere/Javatar/utils/downloader.py/Downloader.download_file--crossover with--dataset/ETHPy150Open sysdream/pysqli/pysqli/core/injector.py/ContextBasedInjector.process_response