def iterate_chunks(file, chunk_size):
    """
    Iterate chunks of size chunk_size from a file-like object
    """
    chunk = file.read(chunk_size)
    while chunk:
        yield chunk
        chunk = file.read(chunk_size)
