code: def zlib_decompress_all_frames(data):
      
      frames = bytearray()
      data = bytes(data)
      while data:
          decomp = zlib.decompressobj()
          try:
              frames.extend(decomp.decompress(data))
              data = decomp.unused_data
          except zlib.error:
              frames.extend(data)
              break
      return frames
docs: Decompress all frames of zlib-compressed bytes.
  
      Repeatedly tries to decompress `data` until all data are decompressed, or decompression
      fails. This will skip over bytes that are not compressed with zlib.
  
      Parameters
      ----------
      data : bytearray or bytes
          Binary data compressed using zlib.
  
      Returns
      -------
          bytearray
              All decompressed bytes