def unzip(zip_file_path, output_dir, permission=None):
with zipfile.ZipFile(zip_file_path, '<STR_LIT:r>') as zip_ref:<EOL><INDENT>for file_info in zip_ref.infolist():<EOL><INDENT>name = file_info.filename<EOL>extracted_path = os.path.join(output_dir, name)<EOL>zip_ref.extract(name, output_dir)<EOL>_set_permissions(file_info, extracted_path)<EOL>_override_permissions(extracted_path, permission)<EOL><DEDENT><DEDENT>_override_permissions(output_dir, permission)<EOL>
Unzip the given file into the given directory while preserving file permissions in the process.

Parameters
----------
zip_file_path : str
    Path to the zip file

output_dir : str
    Path to the directory where the it should be unzipped to

permission : octal int
    Permission to set