def METHOD_NAME(blob: bytes, zdict: bytes) -> bytes:
    comp_obj = zlib.compressobj(zdict=zdict)
    compressed_blob = comp_obj.compress(blob)
    compressed_blob += comp_obj.flush()
    return compressed_blob