<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_bagit_stream(dir_name, payload_info_list):
 """Create a stream containing a BagIt zip archive. Args: dir_name : str The name of the root directory in the zip file, under which all the files are placed (avoids "zip bombs"). payload_info_list: list List of payload_info_dict, each dict describing a file. - keys: pid, filename, iter, checksum, checksum_algorithm - If the filename is None, the pid is used for the filename. """

    zip_file = zipstream.ZipFile(mode='w', compression=zipstream.ZIP_DEFLATED)
    _add_path(dir_name, payload_info_list)
    payload_byte_count, payload_file_count = _add_payload_files(
        zip_file, payload_info_list
    )
    tag_info_list = _add_tag_files(
        zip_file, dir_name, payload_info_list, payload_byte_count, payload_file_count
    )
    _add_manifest_files(zip_file, dir_name, payload_info_list, tag_info_list)
    _add_tag_manifest_file(zip_file, dir_name, tag_info_list)
    return zip_file