<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _chunk_write(chunk, local_file, progress):
 """Write a chunk to file and update the progress bar."""

    local_file.write(chunk)
    if progress is not None:
        progress.update(len(chunk))