INNER CODE UNIT · Python

end

steineggerlab/foldcomp · foldcomp/setup.py:51

                end = min((i + 1) * file_size // chunks, file_size) - 1
                output_chunk = f"{output}.{i}"
                # adjust start if output_chunk already partially exists
                mode = "wb"
                if os.path.exists(output_chunk):
                    start += os.path.getsize(output_chunk)
                    mode = "ab"
                if start < end:
                    ranges.append((start, end, output_chunk, mode))
        else:
            ranges.append((0, file_size, output, "wb"))

        await asyncio.gather(*[download_range(client, url, *range) for range in ranges])

        if len(ranges) == 1:
            return

        with open(output, "wb") as o:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…