def read_block(f, offset, length, delimiter=None):
    if offset != f.tell():  # commonly both zero
        f.seek(offset)

    if not offset and length is None and f.tell() == 0:
        return f.read()

    if delimiter:
        seek_delimiter(f, delimiter, 2**16)
        start = f.tell()
        length -= start - offset

        f.seek(start + length)
        seek_delimiter(f, delimiter, 2**16)
        end = f.tell()

        offset = start
        length = end - start

        f.seek(offset)

    return f.read(length)
Read a block of bytes from a file
dataset/ETHPy150Open dask/dask/dask/bytes/utils.py/read_block