Today while reversing a custom PyInstaller bundle, I needed to decompress a multi-stream zlib compressed archive, and since I spent way too much time trying to understand how I was supposed to do it, here is the resulting snippet in Python:
import sys
import zlib
with open(sys.argv[1], 'rb') as f:
stream = f.read()
while stream:
dco = zlib.decompressobj()
dec = dco.decompress(stream)
print('[+] found stream with len %d' % len(dec)))
stream = dco.unused_data